style;打包配置修改
Showing
1 changed file
with
4 additions
and
6 deletions
| ... | @@ -49,7 +49,7 @@ module.exports = { | ... | @@ -49,7 +49,7 @@ module.exports = { |
| 49 | } | 49 | } |
| 50 | }, | 50 | }, |
| 51 | css: { | 51 | css: { |
| 52 | extract: false, // 是否使用css分离插件 ExtractTextPlugin | 52 | extract: true, // 是否使用css分离插件 ExtractTextPlugin |
| 53 | sourceMap: false, // 开启 CSS source maps? | 53 | sourceMap: false, // 开启 CSS source maps? |
| 54 | loaderOptions: { | 54 | loaderOptions: { |
| 55 | sass: { | 55 | sass: { |
| ... | @@ -61,15 +61,13 @@ module.exports = { | ... | @@ -61,15 +61,13 @@ module.exports = { |
| 61 | // configureWebpack通过操作对象的形式,来修改默认的webpack配置 | 61 | // configureWebpack通过操作对象的形式,来修改默认的webpack配置 |
| 62 | configureWebpack: { | 62 | configureWebpack: { |
| 63 | name: name, | 63 | name: name, |
| 64 | entry: { | 64 | entry: './src/main.js', |
| 65 | app: './src/main.js' | ||
| 66 | }, | ||
| 67 | resolve: { | 65 | resolve: { |
| 68 | alias: { | 66 | alias: { |
| 69 | '@': resolve('src') | 67 | '@': resolve('src') |
| 70 | } | 68 | } |
| 71 | }, | 69 | }, |
| 72 | devtool: '#eval-source-map' //测试 | 70 | devtool: process.env.NODE_ENV === 'development' ? '#eval-source-map' : false |
| 73 | }, | 71 | }, |
| 74 | // chainWebpack通过链式编程的形式,来修改默认的webpack配置 | 72 | // chainWebpack通过链式编程的形式,来修改默认的webpack配置 |
| 75 | chainWebpack (config) { | 73 | chainWebpack (config) { |
| ... | @@ -84,8 +82,8 @@ module.exports = { | ... | @@ -84,8 +82,8 @@ module.exports = { |
| 84 | include: 'initial' | 82 | include: 'initial' |
| 85 | } | 83 | } |
| 86 | ]) | 84 | ]) |
| 87 | |||
| 88 | // when there are many pages, it will cause too many meaningscss requests | 85 | // when there are many pages, it will cause too many meaningscss requests |
| 86 | config.plugins.delete('prefetch') | ||
| 89 | config.module | 87 | config.module |
| 90 | .rule('svg') | 88 | .rule('svg') |
| 91 | .exclude.add(resolve('src/image/icons')) | 89 | .exclude.add(resolve('src/image/icons')) | ... | ... |
-
Please register or sign in to post a comment