@@ -5,8 +5,10 @@ module.exports = (api, _options) => {
55 const browserExtension = Object . assign ( { } , _options )
66 delete browserExtension . registry
77 delete browserExtension . components
8- // const hasRouter = api.hasPlugin('router')
9- // const hasVuex = api.hasPlugin('vuex')
8+ delete browserExtension . generateSigningKey
9+
10+ const hasRouter = api . hasPlugin ( 'router' )
11+ const hasVuex = api . hasPlugin ( 'vuex' )
1012 const hasTs = api . hasPlugin ( 'typescript' )
1113 const hasLint = api . hasPlugin ( 'eslint' )
1214 const fileExt = hasTs ? 'ts' : 'js'
@@ -48,51 +50,44 @@ module.exports = (api, _options) => {
4850 const options = Object . assign ( { } , _options )
4951 options . name = name
5052 options . description = description
51- // options.hasRouter = hasRouter
52- // options.hasVuex = hasVuex
53+ options . hasRouter = hasRouter
54+ options . hasVuex = hasVuex
5355 options . hasTs = hasTs
5456 options . hasLint = hasLint
5557 options . fileExt = fileExt
5658
5759 api . render ( './template/base-app' , options )
58- api . render ( { './src/components/HelloWorld.vue' : `./template/HelloWorld.${ fileExt } .vue` } , options )
60+ const additionalFiles = { './src/components/HelloWorld.vue' : `./template/HelloWorld.${ fileExt } .vue` }
5961
6062 if ( options . components . background ) {
61- api . render (
62- {
63- [ `./src/background.${ fileExt } ` ] : `./template/background/src/background.js`
64- } ,
65- options
66- )
63+ additionalFiles [ `./src/background.${ fileExt } ` ] = './template/background/src/background.js'
6764 }
6865
6966 if ( options . components . contentScripts ) {
70- api . render (
71- {
72- [ `./src/content-scripts/content-script.${ fileExt } ` ] : `./template/content-scripts/src/content-scripts/content-script.js`
73- } ,
74- options
75- )
67+ additionalFiles [ `./src/content-scripts/content-script.${ fileExt } ` ] =
68+ './template/content-scripts/src/content-scripts/content-script.js'
7669 }
7770
71+ api . render ( additionalFiles , options )
72+
7873 if ( options . components . popup ) {
79- renderDomain ( { title : 'Popup' , ext : fileExt , options, api } )
74+ renderDomain ( { title : 'Popup' , fileExt, options, api, hasMinimumSize : true } )
8075 }
8176
8277 if ( options . components . options ) {
83- renderDomain ( { title : 'Options' , ext : fileExt , options, api } )
78+ renderDomain ( { title : 'Options' , fileExt, options, api, hasMinimumSize : true } )
8479 }
8580
8681 if ( options . components . override ) {
87- renderDomain ( { title : 'Override' , ext : fileExt , options, api } )
82+ renderDomain ( { title : 'Override' , fileExt, options, api } )
8883 }
8984
9085 if ( options . components . standalone ) {
91- renderDomain ( { title : 'Standalone' , filename : 'index.html' , ext : fileExt , options, api } )
86+ renderDomain ( { title : 'Standalone' , filename : 'index.html' , fileExt, options, api } )
9287 }
9388
9489 if ( options . components . devtools ) {
95- renderDomain ( { title : 'Devtools' , ext : fileExt , options, api } )
90+ renderDomain ( { title : 'Devtools' , fileExt, options, api } )
9691 }
9792
9893 if ( options . generateSigningKey === true ) {
0 commit comments