Closed
Description
Version
3.9.2
Environment info
//--- vue.config.js
const path = require('path')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
module.exports = {
publicPath: '/',
configureWebpack: {
module: {
rules: [
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: [
"css-loader",
"sass-loader",
{
loader: 'sass-resources-loader',
options: {
resources: path.resolve(__dirname, `./src/theme/${process.env.VUE_APP_THEME}.scss`) //主题皮肤文件全局注入
}
}
]
})
},
]
},
plugins: [
new ExtractTextPlugin({
filename: `theme/${process.env.VUE_APP_THEME}.css`,
allChunks: true
}),
],
}
}
//App.vue
<template>
<div>
<top-nav></top-nav>
<router-view></router-view>
</div>
</template>
<style lang="scss">
</style>
// ---------------------
Steps to reproduce
npm run build
What is expected?
The packaged CSS file contain non-routing components
What is actually happening?
The packaged CSS file does not contain non-routing components(App, TopNav)