Skip to content

Commit c972ad0

Browse files
committed
将.vue中的style打包后单独分离成css文件
1 parent 576f89b commit c972ad0

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

build/webpack.dist.config.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,15 @@ const webpackConfig = {
4040
loader: 'vue-loader',
4141
options: {
4242
extractCSS: true, // 单独使用.scss
43-
loaders: {
44-
scss: 'vue-style-loader!css-loader!sass-loader', // <style lang="scss">
45-
sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax' // <style lang="sass">
46-
}
43+
use: extractSass.extract({
44+
use: [{
45+
loader: 'css-loader'
46+
}, {
47+
loader: 'sass-loader'
48+
}],
49+
// 在开发环境使用 style-loader
50+
fallback: 'style-loader'
51+
})
4752
}
4853
},
4954
{

src/components/layout.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@
116116
117117
.el-aside {
118118
background-color: #383a4b;
119+
.el-menu{
120+
border-right: 0;
121+
}
119122
}
120123
121124
.el-main {

0 commit comments

Comments
 (0)