Simplifying build scripts

This commit is contained in:
Jean Viscogliosi-Pate 2025-01-26 23:20:00 -08:00
parent 834a052bdd
commit acaa18ab4f
2 changed files with 11 additions and 8 deletions

View File

@ -10,18 +10,22 @@ MetamorPOV includes Node packages for verb conjugation. You'll need [Node](https
# Install project dependencies
npm install
# Bundle replace-words.js and its dependencies into content-script.js
# Generate a .zip that can be loaded in a browser
npm run build
```
### Testing
When running the extension with the `test` script, it will be updated automatically as source files are modified. To appear while testing, modifications to `replace-words.js` must be manually bundled into `content-script.js`.
```sh
# Open a browser instance with the extension installed
npm run test
# Generate a .zip that can be loaded in a browser
npm run package
# Manually bundle replace-words.js into content-script.js
npx rollup -c
```
When running the extension with the `test` script, it will be updated automatically as source files are modified. This excludes `content-script.js`, which has to be bundled manually by running the `build` script.
## Copyright and License
- Portions of MetamorPOV are derived from [InteractiveFics](https://github.com/interactivefics/interactive-fics), licensed under [MIT](third-party-licenses/LICENSE-InteractiveFics), copyrighted 2015-2023 by Mariam Maarouf.

View File

@ -11,9 +11,8 @@
"author": "Jean Viscogliosi-Pate",
"license": "GPL-3.0-or-later",
"scripts": {
"build": "npx rollup -c",
"test": "npx web-ext run -s src",
"package": "npx web-ext build -s src"
"test": "npx rollup -c && npx web-ext run -s src",
"build": "npx rollup -c && npx web-ext build -s src --overwrite-dest"
},
"devDependencies": {
"@rollup/plugin-commonjs": "28.0.2",