Skip to content

Commit 11999f3

Browse files
authored
Removes scripts from background section of google V3 manifest file (#41)
* Automatically Remove the 'services' section from the background worker on Google Manifest files. * Automatically Remove the 'services' section from the background worker on Google Manifest files.
1 parent 2e33a3f commit 11999f3

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"mini-css-extract-plugin": "^0.11.3",
2424
"node-sass": "^7.0.0",
2525
"prettier": "^2.3.2",
26+
"replace-in-file-webpack-plugin": "^1.0.6",
2627
"sass": "^1.39.0",
2728
"sass-loader": "^10.2.0",
2829
"style-loader": "^1.3.0",

webextension-toolbox.config.js

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// const webpack = require('webpack');
22
const VueLoaderPlugin = require('vue-loader/lib/plugin');
33
// const MiniCssExtractPlugin = require("mini-css-extract-plugin");
4-
4+
const ReplaceInFileWebpackPlugin = require('replace-in-file-webpack-plugin');
55
// console.log("webpack", webpack);
66

77
module.exports = {
@@ -58,6 +58,19 @@ module.exports = {
5858
config.plugins.push(new VueLoaderPlugin());
5959
// config.plugins.push(new MiniCssExtractPlugin());
6060

61+
config.plugins.push(
62+
new ReplaceInFileWebpackPlugin([{
63+
dir: 'dist/chrome',
64+
files: ['manifest.json'],
65+
rules: [
66+
{
67+
search: /"scripts(.*)"service_worker"/sig,
68+
replace: '"service_worker"'
69+
}
70+
]
71+
}])
72+
)
73+
6174
return config
6275
}
6376
};

0 commit comments

Comments
 (0)