Skip to content

Commit 9670ed4

Browse files
committed
Fixed generator bug where generation fails on contentScripts or background
Fixes #56
1 parent b1ed79a commit 9670ed4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

generator/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
const path = require('path')
21
const { generateKey } = require('../lib/signing-key')
32
const { renderDomain, renderGitignore, renderTs } = require('../lib/render')
43

@@ -13,12 +12,12 @@ module.exports = (api, _options) => {
1312
const fileExt = hasTs ? 'ts' : 'js'
1413

1514
browserExtension.componentOptions = {}
16-
if (browserExtension.components.background) {
15+
if (_options.components.background) {
1716
browserExtension.componentOptions.background = {
1817
entry: `src/background.${fileExt}`
1918
}
2019
}
21-
if (browserExtension.components.contentScripts) {
20+
if (_options.components.contentScripts) {
2221
browserExtension.componentOptions.contentScripts = {
2322
entries: {
2423
'content-script': [`src/content-scripts/content-script.${fileExt}`]
@@ -46,7 +45,7 @@ module.exports = (api, _options) => {
4645
api.extendPackage(pkg)
4746

4847
const { name, description } = require(api.resolve('package.json'))
49-
const options = Object.assign({}, browserExtension)
48+
const options = Object.assign({}, _options)
5049
options.name = name
5150
options.description = description
5251
// options.hasRouter = hasRouter

0 commit comments

Comments
 (0)