mirror of
https://github.com/abhijithvijayan/web-extension-starter.git
synced 2025-10-07 07:22:37 +02:00
write background property to manifest dynamically
This commit is contained in:
parent
3fc3d01d17
commit
5bf7a70694
@ -4,10 +4,6 @@
|
||||
"short_name": "Sample Name",
|
||||
"description": "Sample description",
|
||||
"homepage_url": "https://github.com/abhijithvijayan/web-extension-starter",
|
||||
"background": {
|
||||
"persistent": false,
|
||||
"scripts": ["js/background.js"]
|
||||
},
|
||||
"manifest_version": 2,
|
||||
"minimum_chrome_version": "49",
|
||||
"permissions": ["tabs", "storage", "http://*/*", "https://*/*"],
|
||||
|
||||
@ -4,9 +4,6 @@
|
||||
"short_name": "Sample Name",
|
||||
"description": "Sample description",
|
||||
"homepage_url": "https://github.com/abhijithvijayan/kutt-extension",
|
||||
"background": {
|
||||
"scripts": ["js/background.js"]
|
||||
},
|
||||
"manifest_version": 2,
|
||||
"permissions": ["tabs", "storage", "http://*/*", "https://*/*"],
|
||||
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
|
||||
|
||||
@ -6,10 +6,6 @@
|
||||
"short_name": "Sample Name",
|
||||
"description": "Sample description",
|
||||
"homepage_url": "https://github.com/abhijithvijayan/web-extension-starter",
|
||||
"background": {
|
||||
"persistent": false,
|
||||
"scripts": ["js/background.js"]
|
||||
},
|
||||
"manifest_version": 2,
|
||||
"minimum_opera_version": "36",
|
||||
"permissions": ["tabs", "storage", "http://*/*", "https://*/*"],
|
||||
|
||||
@ -37,12 +37,15 @@ module.exports = {
|
||||
{ from: 'src/assets', to: 'assets' },
|
||||
{
|
||||
from: `src/manifests/${process.env.TARGET}.json`,
|
||||
// expose and write the allowed env vars on the compiled bundle
|
||||
transform(content, path) {
|
||||
// generates the manifest file using the package.json informations
|
||||
return Buffer.from(
|
||||
JSON.stringify({
|
||||
version: process.env.npm_package_version,
|
||||
background: {
|
||||
persistent: false,
|
||||
scripts: ['js/background.bundle.js'],
|
||||
},
|
||||
...JSON.parse(content.toString()),
|
||||
})
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user