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 = {
4040 // CSS related options
4141 css: {
4242 // 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
4344 extract: true ,
4445
4546 // enable CSS source maps?
Original file line number Diff line number Diff line change @@ -103,18 +103,15 @@ module.exports = (api, options) => {
103103
104104 // inject CSS extraction plugin
105105 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
108108 : { }
109109 webpackConfig
110110 . plugin ( 'extract-css' )
111111 . use ( ExtractTextPlugin , [ Object . assign ( {
112112 filename : `css/[name].[contenthash:8].css` ,
113113 allChunks : true
114- } , userOptions ) ] )
114+ } , extractOptions ) ] )
115115 }
116-
117- // TODO document receipe for using css.loaderOptions to add `data` option
118- // to sass-loader
119116 } )
120117}
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ const schema = createSchema(joi => joi.object({
1616 // css
1717 css : joi . object ( {
1818 modules : joi . boolean ( ) ,
19- extract : joi . boolean ( ) ,
19+ extract : joi . alternatives ( ) . try ( joi . boolean ( ) , joi . object ( ) ) ,
2020 localIdentName : joi . string ( ) ,
2121 sourceMap : joi . boolean ( ) ,
2222 loaderOptions : joi . object ( {
You can’t perform that action at this time.
0 commit comments