File tree Expand file tree Collapse file tree 4 files changed +23
-14
lines changed
packages/@vue/cli-service Expand file tree Collapse file tree 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')
44const chalk = require ( 'chalk' )
55const readPkg = require ( 'read-pkg' )
66const merge = require ( 'webpack-merge' )
7- const deepMerge = require ( 'deepmerge' )
87const Config = require ( 'webpack-chain' )
98const PluginAPI = require ( './PluginAPI' )
109const loadEnv = require ( './util/loadEnv' )
@@ -21,10 +20,9 @@ module.exports = class Service {
2120 this . devServerConfigFns = [ ]
2221 this . commands = { }
2322 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 )
2826
2927 debug ( 'vue:project-config' ) ( this . projectOptions )
3028
Original file line number Diff line number Diff line change @@ -15,7 +15,13 @@ module.exports = (api, options) => {
1515 const ExtractTextPlugin = require ( 'extract-text-webpack-plugin' )
1616
1717 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 || { } )
1925 const extract = isProd && userOptions . extract !== false
2026
2127 // 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({
2222 } )
2323 } ) ,
2424 devServer : joi . object ( ) ,
25+
2526 // 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+ )
2735} ) )
2836
2937exports . validate = options => validate (
@@ -58,12 +66,10 @@ exports.defaults = () => ({
5866 dll : false ,
5967
6068 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: {}
6773 } ,
6874
6975 // whether to use eslint-loader
Original file line number Diff line number Diff line change 3232 "chalk" : " ^2.3.0" ,
3333 "copy-webpack-plugin" : " ^4.3.1" ,
3434 "css-loader" : " ^0.28.9" ,
35- "deepmerge" : " ^2.0.1" ,
3635 "escape-string-regexp" : " ^1.0.5" ,
3736 "extract-text-webpack-plugin" : " ^3.0.2" ,
3837 "file-loader" : " ^1.1.6" ,
You can’t perform that action at this time.
0 commit comments