Can't get MiniCssExtractPlugin working with Vue single component files.
Archlinux node v10.3.0
module: {
rules: [
{
exclude: /node_modules/,
test: /\.vue$/,
loader: 'vue-loader',
},
{
test: /\.sass$/,
use: [
MiniCssExtractPlugin.loader,
"style-loader",
"css-loader",
"sass-loader?indentedSyntax"
]
},
]
}
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ReferenceError: window is not defined
at eval (webpack:///./node_modules/style-loader/lib/addStyles.js?:23:2)
at eval (webpack:///./node_modules/style-loader/lib/addStyles.js?:12:46)
steps to reproduce:
git clone https://github.com/Deathangel908/vue-webpack-minimal && cd vue-webpack-minimalnpm installnpm run buildOh I shouldn't use style-loader...
{
test: /\.sass$/,
use: [
MiniCssExtractPlugin.loader,
"css-loader",
"sass-loader?indentedSyntax"
]
},
@Deathangel908 Why we shouldn't use style-loader? Thanks for an explanation.
@f3l1x - From the README of style-loader:
Adds CSS to the DOM by injecting a
Most helpful comment
Oh I shouldn't use style-loader...
{ test: /\.sass$/, use: [ MiniCssExtractPlugin.loader, "css-loader", "sass-loader?indentedSyntax" ] },