Closed jhirn closed 2 years ago
Don't use sass-loader and fast-sass-loader together ...
In your environment.js:
const sassLoader = environment.loaders.get('sass');
const idx = sassLoader.use.findIndex(({ loader }) => loader === 'sass-loader');
const p = path.resolve(__dirname, '../../frontend/');
sassLoader.use.splice(idx, 1, {
loader: 'fast-sass-loader',
options: {
includePaths: [p],
resolveUrls: false,
}
});
sassLoader.use.splice(-1, 0, {
loader: 'resolve-url-loader'
});
But I couldn't get imports to work.
Hello. I'm trying to figure out how to use the with Rails and Webpacker. I was assuming it was a direct replacement for the
sass-loader
andresolve-url-helper
but i can't seem to get it to rewrite/resolveurl(..)
tags in my scss files.Here is how I've added it to the loaders.
Output from the speed measure webpack plugin tells me that it is being used in the chain, although the order is a bit curious
I've also tried without the includePaths. Additionally, I've completely removed the sass loader form package.json yet same thing. Seeing these types of errors: