Skip to content

Commit 3350582

Browse files
committed
Revert making icons optional, scaffold them in the public dir instead
Since the icons are now in the public dir, the plugin does not need to copy them.
1 parent addf2d2 commit 3350582

File tree

9 files changed

+7
-26
lines changed

9 files changed

+7
-26
lines changed

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ It makes some assumptions about your project setup.
1616
I hope to be able to scaffold an app so that identifying the below in unnecessary.
1717

1818
```
19+
|- public/
20+
|- icons/
21+
|- Icons for your extension. Should include a 16, 19, 38, 48, 128 px square image
1922
|- src/
2023
|- assets/
2124
|- Static assets in use in your app, like logo.png
2225
|- content_scripts
2326
|- content-script.js
24-
|- icons/
25-
|- Icons for your extension. Should include a 16, 19, 38, 48, 128 px square image
2627
|- options/ (asked during project generation)
2728
|- App.vue
2829
|- options.html
@@ -102,13 +103,11 @@ module.exports = {
102103
- options
103104
- contentScripts
104105
- standalone
105-
- icons
106106

107107
```js
108108
components: {
109109
background: true,
110-
contentScripts: true,
111-
icons: true
110+
contentScripts: true
112111
}
113112
```
114113

generator/index.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@ module.exports = (api, _options) => {
9696
api.render('./template/content-script', { ...options })
9797
}
9898

99-
if (options.components.icons) {
100-
api.render('./template/icons', { name, ...options })
101-
}
102-
10399
api.onCreateComplete(() => {
104100
const gitignore = fs.readFileSync(api.resolve('./.gitignore'), 'utf8')
105101
fs.writeFileSync(api.resolve('./.gitignore'), gitignore + gitignoreSnippet)

index.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,7 @@ module.exports = (api, options) => {
6565
}
6666
}
6767

68-
const toCopy = []
69-
70-
if (pluginOptions.components.icons) {
71-
toCopy.push({ from: './src/icons', to: 'icons/[name].[ext]', ignore: ['icon.xcf'] })
72-
}
73-
74-
toCopy.push({
68+
webpackConfig.plugins.push(new CopyWebpackPlugin({
7569
from: './src/manifest.json',
7670
to: 'manifest.json',
7771
transform: (content) => {
@@ -108,9 +102,7 @@ module.exports = (api, options) => {
108102
}
109103
})
110104
}
111-
})
112-
113-
webpackConfig.plugins.push(new CopyWebpackPlugin(toCopy))
105+
}))
114106

115107
if (isProduction) {
116108
webpackConfig.plugins.push(new ZipPlugin({

prompts.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = [
22
{
33
name: 'components',
44
type: 'checkbox',
5-
default: ['popup', 'background', 'icons'],
5+
default: ['popup', 'background'],
66
message: 'Which browser extension components do you wish to generate?',
77
choices: [
88
{
@@ -36,12 +36,6 @@ module.exports = [
3636
// name: 'Dev Tools Tab',
3737
// value: 'devTools',
3838
// short: 'dev tools'
39-
},
40-
{
41-
name: 'Icons',
42-
value: 'icons',
43-
short: 'icons',
44-
checked: true
4539
}
4640
],
4741
filter: async (input) => {

0 commit comments

Comments
 (0)