From 84e1852f28a139d6dce0e9e7677bd21b8050890b Mon Sep 17 00:00:00 2001 From: Leon Bubova Date: Fri, 17 Dec 2021 01:03:25 +0100 Subject: [PATCH 1/4] add build file to gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index e15e75a..85f9dce 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,6 @@ yarn-error.log* *.sw* node_modules + +# Build files +Extensions/combined/bundled-content-script.js \ No newline at end of file From f3fad5cce13b68da07a37da50fbb48ad523237ae Mon Sep 17 00:00:00 2001 From: Leon Bubova Date: Fri, 17 Dec 2021 01:04:20 +0100 Subject: [PATCH 2/4] remove watch from webpack options --- webpack.config.js | 1 - 1 file changed, 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 002b243..9452fa7 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -10,5 +10,4 @@ module.exports = { ramda: "R", }, module: {}, - watch: true }; From c46065fdc0a236ce17d2c567089d915b2bfb6a0f Mon Sep 17 00:00:00 2001 From: Leon Bubova Date: Fri, 17 Dec 2021 01:06:23 +0100 Subject: [PATCH 3/4] rename bundle script to start with file watcher, create build script without watcher --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6c0cb42..b5646da 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,9 @@ "description": "Chrome extension to return youtube dislikes", "main": "ryd.content-script.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "bundle": "node_modules/.bin/webpack \"./Extensions/combined/ryd.content-script.js\" -o \"./Extensions/combined\"" + "start": "node_modules/.bin/webpack \"./Extensions/combined/ryd.content-script.js\" -o \"./Extensions/combined\" --watch", + "build": "node_modules/.bin/webpack \"./Extensions/combined/ryd.content-script.js\" -o \"./Extensions/combined\"", + "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { "type": "git", From 4e2773f7b9560543eb3c06e79b9d0420039d88a2 Mon Sep 17 00:00:00 2001 From: Leon Bubova Date: Fri, 17 Dec 2021 01:09:02 +0100 Subject: [PATCH 4/4] update docs with new scripts --- CONTRIBUTING.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1a41707..e9248df 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,10 +25,12 @@ npm install 2. Run the following command to create `bundled-content-script.js` which is used in `manifest.json` ``` -npm run bundle -``` +npm start // to create the build file(s) and start a file watcher that hot-reloads on save -This will also start a watcher that re-bundles automatically once you save a file inside the source. +// or + +npm run build // to create the build file(s) once +``` Congratulations, You are now ready to develop!