File tree Expand file tree Collapse file tree 3 files changed +5
-7
lines changed
packages/@vue/cli-service/lib Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ module.exports = {
40
40
// CSS related options
41
41
css: {
42
42
// extract CSS in components into a single CSS file (only in production)
43
+ // can also be an object of options to pass to extract-text-webpack-plugin
43
44
extract: true ,
44
45
45
46
// enable CSS source maps?
Original file line number Diff line number Diff line change @@ -103,18 +103,15 @@ module.exports = (api, options) => {
103
103
104
104
// inject CSS extraction plugin
105
105
if ( extract ) {
106
- const userOptions = options . extractCSS && typeof options . extractCSS === 'object'
107
- ? options . extractCSS
106
+ const extractOptions = userOptions . extract && typeof userOptions . extract === 'object'
107
+ ? userOptions . extract
108
108
: { }
109
109
webpackConfig
110
110
. plugin ( 'extract-css' )
111
111
. use ( ExtractTextPlugin , [ Object . assign ( {
112
112
filename : `css/[name].[contenthash:8].css` ,
113
113
allChunks : true
114
- } , userOptions ) ] )
114
+ } , extractOptions ) ] )
115
115
}
116
-
117
- // TODO document receipe for using css.loaderOptions to add `data` option
118
- // to sass-loader
119
116
} )
120
117
}
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ const schema = createSchema(joi => joi.object({
16
16
// css
17
17
css : joi . object ( {
18
18
modules : joi . boolean ( ) ,
19
- extract : joi . boolean ( ) ,
19
+ extract : joi . alternatives ( ) . try ( joi . boolean ( ) , joi . object ( ) ) ,
20
20
localIdentName : joi . string ( ) ,
21
21
sourceMap : joi . boolean ( ) ,
22
22
loaderOptions : joi . object ( {
You can’t perform that action at this time.
0 commit comments