While css files resolve just fine, in scss it simply won't resolve. Does anyone knows the solution? Sass-loader tells me to use 'resolve-url-loader', but I can't make it work. Im trying to add font-awesome. If i use the css version it works just fine (with file loader even copy fonts to dist) but with scss no.
Here is my prod config file.
webpack.production.js
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const TerserJSPlugin = require('terser-webpack-plugin');
const plugins = [
new HtmlWebpackPlugin({
inject: false,
hash: true,
template: __dirname + '/../src/app/Views/layouts/layout-template.phtml',
filename: __dirname + '/../src/app/Views/layouts/layout.phtml'
}),
new MiniCssExtractPlugin({
filename: 'css/[name].css',
chunkFilename: 'css/[name].css',
}),
];
module.exports = () => ({
output: {
publicPath: '/dist/',
},
optimization: {
minimize: true,
minimizer: [new TerserJSPlugin({
terserOptions: {
extractComments: 'all',
compress: {
drop_console: true
}
}
}), new OptimizeCSSAssetsPlugin({})],
},
module: {
rules: [
{
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
},
{
test: /\.(sa|sc|c)ss$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
},
'css-loader?',
'postcss-loader',
'resolve-url-loader',
'sass-loader'
],
}
]
},
plugins
});
Thanks in advance. Cheers