File tree 4 files changed +23
-14
lines changed
packages/@vue/cli-service
4 files changed +23
-14
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ const debug = require('debug')
4
4
const chalk = require ( 'chalk' )
5
5
const readPkg = require ( 'read-pkg' )
6
6
const merge = require ( 'webpack-merge' )
7
- const deepMerge = require ( 'deepmerge' )
8
7
const Config = require ( 'webpack-chain' )
9
8
const PluginAPI = require ( './PluginAPI' )
10
9
const loadEnv = require ( './util/loadEnv' )
@@ -21,10 +20,9 @@ module.exports = class Service {
21
20
this . devServerConfigFns = [ ]
22
21
this . commands = { }
23
22
this . pkg = this . resolvePkg ( pkg )
24
- this . projectOptions = deepMerge (
25
- defaults ( ) ,
26
- this . loadProjectOptions ( projectOptions )
27
- )
23
+
24
+ const userOptions = this . loadProjectOptions ( projectOptions )
25
+ this . projectOptions = Object . assign ( defaults ( ) , userOptions )
28
26
29
27
debug ( 'vue:project-config' ) ( this . projectOptions )
30
28
Original file line number Diff line number Diff line change @@ -15,7 +15,13 @@ module.exports = (api, options) => {
15
15
const ExtractTextPlugin = require ( 'extract-text-webpack-plugin' )
16
16
17
17
const isProd = process . env . NODE_ENV === 'production'
18
- const userOptions = options . css || { }
18
+ const defaultOptions = {
19
+ extract : true ,
20
+ modules : false ,
21
+ sourceMap : false ,
22
+ loaderOptions : { }
23
+ }
24
+ const userOptions = Object . assign ( defaultOptions , options . css || { } )
19
25
const extract = isProd && userOptions . extract !== false
20
26
21
27
// check if the project has a valid postcss config
Original file line number Diff line number Diff line change @@ -22,8 +22,16 @@ const schema = createSchema(joi => joi.object({
22
22
} )
23
23
} ) ,
24
24
devServer : joi . object ( ) ,
25
+
25
26
// known options from offical plugins
26
- lintOnSave : joi . boolean ( )
27
+ lintOnSave : joi . boolean ( ) ,
28
+
29
+ // webpack
30
+ chainWebpack : joi . func ( ) ,
31
+ configureWebpack : joi . alternatives ( ) . try (
32
+ joi . object ( ) ,
33
+ joi . func ( )
34
+ )
27
35
} ) )
28
36
29
37
exports . validate = options => validate (
@@ -58,12 +66,10 @@ exports.defaults = () => ({
58
66
dll : false ,
59
67
60
68
css : {
61
- // boolean | Object, extract css?
62
- extract : true ,
63
- // apply css modules to CSS files that doesn't end with .module.css?
64
- modules : false ,
65
- sourceMap : false ,
66
- loaderOptions : { }
69
+ // extract: true,
70
+ // modules: false,
71
+ // sourceMap: false,
72
+ // loaderOptions: {}
67
73
} ,
68
74
69
75
// whether to use eslint-loader
Original file line number Diff line number Diff line change 32
32
"chalk" : " ^2.3.0" ,
33
33
"copy-webpack-plugin" : " ^4.3.1" ,
34
34
"css-loader" : " ^0.28.9" ,
35
- "deepmerge" : " ^2.0.1" ,
36
35
"escape-string-regexp" : " ^1.0.5" ,
37
36
"extract-text-webpack-plugin" : " ^3.0.2" ,
38
37
"file-loader" : " ^1.1.6" ,
You can’t perform that action at this time.
0 commit comments