I am using Vue CLI which abstracts away much of the Webpack configuration for running and building the application. This comes with some benefits, but I am at a loss as to how to create specific rules for a directory of .scss files.
I would like these files to not be extracted into a single .css file on build, but to be individually compiled into a themes directory (./dist/themes).
I have tried to create a rule in vue.config.js to recognise the directory but it does not work:
module.exports = {
runtimeCompiler: true,
configureWebpack: config => {
config.module.rules.push(
{
test: /\.md$/,
use: 'raw-loader'
},
{
test: /\.ya?ml$/,
type: 'json', // Required by Webpack v4
use: 'yaml-loader'
}
)
},
module: {
rules: [
{
test: /\.scss$/i,
loader: 'css-loader',
options: {
import: (url, media, resourcePath) => {
// Find .scss files in src/assets/themes
if (url.includes('./src/assets/themes')) {
}
},
},
},
],
},
}
Thanks