diff --git a/package.json b/package.json index 7ebf45fa..02c5911c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,8 @@ "name": "@mozilla/web-science", "version": "0.2.0", "scripts": { - "lint": "eslint ." + "lint": "eslint .", + "build": "cd tests/build/ && rollup -c" }, "dependencies": { "rollup": "^2.41.4", diff --git a/tests/build/manifest.json b/tests/build/manifest.json new file mode 100644 index 00000000..bc5af3e9 --- /dev/null +++ b/tests/build/manifest.json @@ -0,0 +1,21 @@ +{ + "description": "A build test for the WebScience library.", + "author": "Mozilla", + "manifest_version": 2, + "name": "WebScience Build Test", + "version": "1.0.0", + "homepage_url": "https://github.com/mozilla-rally/web-science", + + "browser_specific_settings": { + "gecko": { + "id": "webScience-build-test@mozilla.org", + "strict_min_version": "87.0" + } + }, + + "background": { + "scripts": ["dist/background.js"] + }, + + "incognito": "not_allowed" +} diff --git a/tests/build/rollup.config.js b/tests/build/rollup.config.js new file mode 100644 index 00000000..28b8a629 --- /dev/null +++ b/tests/build/rollup.config.js @@ -0,0 +1,22 @@ +import commonjs from "@rollup/plugin-commonjs"; +import resolve from "@rollup/plugin-node-resolve"; +import webScienceRollupPlugin from "@mozilla/web-science/rollup-plugin"; + +export default (cliArgs) => { + const rollupConfig = [ + { + input: "src/background.js", + output: { + file: "dist/background.js", + }, + plugins: [ + webScienceRollupPlugin(), + resolve({ + browser: true, + }), + commonjs(), + ], + } + ]; + return rollupConfig; +} diff --git a/tests/build/src/background.js b/tests/build/src/background.js new file mode 100644 index 00000000..183c0458 --- /dev/null +++ b/tests/build/src/background.js @@ -0,0 +1 @@ +import * as WebScience from "../../../src/webScience.js";