File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -27,11 +27,8 @@ module.exports = class Generator {
2727 const api = new GeneratorAPI ( id , this , options , rootOptions || { } )
2828 apply ( api , options , rootOptions )
2929 } )
30- // if the user has chosen so, extract configs from package.json into
31- // dedicated files.
32- if ( extractConfigFiles ) {
33- this . extractConfigFiles ( )
34- }
30+ // extract configs from package.json into dedicated files.
31+ this . extractConfigFiles ( extractConfigFiles )
3532 }
3633
3734 async generate ( ) {
@@ -44,15 +41,23 @@ module.exports = class Generator {
4441 await writeFileTree ( this . context , this . files )
4542 }
4643
47- extractConfigFiles ( ) {
48- for ( const key in this . pkg ) {
44+ extractConfigFiles ( all ) {
45+ const extract = key => {
4946 if ( configMap [ key ] ) {
5047 const value = this . pkg [ key ]
5148 const { transform, filename } = configMap [ key ]
5249 this . files [ filename ] = transform ( value )
5350 delete this . pkg [ key ]
5451 }
5552 }
53+ if ( all ) {
54+ for ( const key in this . pkg ) {
55+ extract ( key )
56+ }
57+ } else {
58+ // by default, extract vue.config.js
59+ extract ( 'vue' )
60+ }
5661 }
5762
5863 sortPkg ( ) {
You can’t perform that action at this time.
0 commit comments