在我的vuejs项目中,我想将我的个人css文件包含在由*.vue文件中的样式生成的缩微css文件中
在app.vue中,我有:
<style lang="scss">
@import '/static/css/AdminLTE.min.css';
@import '/static/css/style.css';
@import '/static/js/plugins/pace/pace.min.css';
</style>
并且我使用ExtractTextPlugin来提取和缩小*.vue文件中的样式:
// extract css into its own file
new ExtractTextPlugin({
filename: utils.assetsPath('css/[name].[contenthash].css')
}),
// Compress extracted CSS. We are using this plugin so that possible
// duplicated CSS from different components can be deduped.
new OptimizeCSSPlugin({
cssProcessorOptions: {
safe: true
}
}),
所以我的网站,插件中的app.conbtenthash.css文件和我导入的三个文件。但有没有反正包括我的三个导入文件在应用程序css文件?
比你强!
文档:https://vue-loader.vuejs.org/en/configurations/extract-css.html
类似的问题:vue.js+Webpack多样式tas输出如何将vue文件样式提取到一个单独的style.css文件中
所以您应该在ExtractTextPlugin中指定单个文件名
new ExtractTextPlugin("style.css")