Closed iatsiuk closed 7 years ago
You need to change the below:
{
...
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
scss: ExtractTextPlugin.extract({
use: 'css-loader!sass-loader',
fallback: 'vue-style-loader'
}),
sass: ExtractTextPlugin.extract({
use: 'css-loader!sass-loader?indentedSyntax',
fallback: 'vue-style-loader'
})
}
}
},
...
module.exports.plugins = (module.exports.plugins || []).concat([
new ExtractTextPlugin({
filename: '[name].[contenthash].css'
})
...
Using webpack2 , styles are still in the bundle
@csonlai +1. But not all .vue files, only the lazy-loading(webpack-code-splited) ones. Those directly imported work out ok. My vue loader:
{
test: /\.vue$/i,
loader: 'vue-loader',
options: {
loaders: {
sass: ExtractPlugin.extract({
use: ['css-loader', 'sass-loader'],
fallback: 'vue-style-loader'
})
}
}
},
My style tag:
<style lang="sass" type="text/scss" rel="stylesheet/scss">
Same issue. Code splitted chunks are not emitted or loaded with the fallback
I'm having same problem I'm only getting output from a single file
Same issue still in 2018. somehow to solve?
for split chunk, please read extract-text-webpack-plugin docs,
you should use allChunks
option, like this:
plugins: [
new ExtractTextPlugin({
allChunks: true,
filename: 'style.css'
})
]
Webpack doesn't emit
style.css
. I've followed instructions from the extract-css.md document.Content of the
webpack.config.js
:Also I've created test repo.