我对这一切都比较陌生,一直在努力让我的字体被包含到我的style.css中。Webpack无法加载字体文件
起初并没有将文件加载由于路径是不正确的(显然它正在从根而不是字体目录本身中的相对路径)
不似乎找到了文件,但告诉我我正在使用错误的加载器。 见下图:
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader',
query: {
presets: ['react', 'es2015', 'stage-0'],
plugins: ['react-html-attrs', 'transform-class-properties', 'transform-decorators-legacy'],
}
},
{
test: /\.scss?$/,
loader: ExtractTextPlugin.extract('css!sass')
},
{
test: /\.(png|woff|woff2|eot|ttf|svg)$/,
loader: 'url-loader?limit=100000'
}
]
},
任何帮助表示赞赏。
BTW,我不知道为什么它说“无法找到模块...... main.scss”如果我删除了@import的字体它发现它很好... – Stefan