Skip to content

Commit 1c8333a

Browse files
committed
Fix firefox specific features that were failing to activate
1 parent 9a4e773 commit 1c8333a

File tree

3 files changed

+96
-2
lines changed

3 files changed

+96
-2
lines changed

firefox.webpack.config.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
const path = require("path");
2+
const {DefinePlugin} = require("webpack");
3+
const CircularDependencyPlugin = require('circular-dependency-plugin');
4+
5+
module.exports = {
6+
mode: "production",
7+
resolve: {
8+
alias: {
9+
Polyfill: path.resolve(__dirname, "src/polyfill.js")
10+
},
11+
modules: [path.resolve(__dirname, "src"), "node_modules"]
12+
},
13+
entry: {
14+
"background/background": "./src/background/background.js",
15+
"background/captureTab": "./src/background/captureTab.js",
16+
"background/tmpClear": "./src/background/tmpClear.js",
17+
"background/commands": "./src/background/commands.js",
18+
"popup/popup": "./src/popup/popup.js",
19+
"content/content": "./src/content/content.js",
20+
"options/options": "./src/options/options.js"
21+
},
22+
output: {
23+
filename: "[name].js",
24+
path: path.resolve(__dirname, "dist")
25+
},
26+
plugins: [
27+
new CircularDependencyPlugin({
28+
exclude: /node_modules|cartographer\/pkg/,
29+
failOnError: true,
30+
allowAsyncCycles: false,
31+
cwd: process.cwd()
32+
}),
33+
new DefinePlugin({
34+
TARGET: "\"firefox\""
35+
})
36+
],
37+
experiments: {
38+
asyncWebAssembly: true,
39+
// buildHttp: true,
40+
// layers: true,
41+
// lazyCompilation: true,
42+
// outputModule: true,
43+
// syncWebAssembly: true,
44+
topLevelAwait: true,
45+
},
46+
cache: false,
47+
};

firefox.webpack.dev.config.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
const path = require("path");
2+
const {DefinePlugin} = require("webpack");
3+
const CircularDependencyPlugin = require('circular-dependency-plugin');
4+
5+
module.exports = {
6+
mode: "development",
7+
devtool: "cheap-module-source-map",
8+
resolve: {
9+
alias: {
10+
Polyfill: path.resolve(__dirname, "src/polyfill.js")
11+
},
12+
modules: [path.resolve(__dirname, "src"), "node_modules"]
13+
},
14+
entry: {
15+
"background/background": "./src/background/background.js",
16+
"background/captureTab": "./src/background/captureTab.js",
17+
"background/tmpClear": "./src/background/tmpClear.js",
18+
"background/commands": "./src/background/commands.js",
19+
"popup/popup": "./src/popup/popup.js",
20+
"content/content": "./src/content/content.js",
21+
"options/options": "./src/options/options.js"
22+
},
23+
output: {
24+
filename: "[name].js",
25+
path: path.resolve(__dirname, "dist")
26+
},
27+
plugins: [
28+
new CircularDependencyPlugin({
29+
exclude: /node_modules|cartographer\/pkg/,
30+
failOnError: true,
31+
allowAsyncCycles: false,
32+
cwd: process.cwd()
33+
}),
34+
new DefinePlugin({
35+
TARGET: "\"firefox\""
36+
})
37+
],
38+
experiments: {
39+
asyncWebAssembly: true,
40+
// buildHttp: true,
41+
// layers: true,
42+
// lazyCompilation: true,
43+
// outputModule: true,
44+
// syncWebAssembly: true,
45+
topLevelAwait: true,
46+
},
47+
};

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"build:chrome.dev": "npm run build:cartographer && webpack --config chrome.webpack.dev.config.js && npm run gen-manifest:chrome",
1313
"build:webext": "npm run build:cartographer && webpack --config webext.webpack.config.js && npm run gen-manifest:webext",
1414
"build:webext.dev": "npm run build:cartographer && webpack --config webext.webpack.dev.config.js && npm run gen-manifest:webext",
15-
"build:firefox": "npm run build:webext",
16-
"build:firefox.dev": "npm run build:webext.dev",
15+
"build:firefox": "npm run build:cartographer && webpack --config firefox.webpack.config.js && npm run gen-manifest:firefox",
16+
"build:firefox.dev": "npm run build:cartographer && webpack --config firefox.webpack.dev.config.js && npm run gen-manifest:firefox",
1717
"build:v2-compat": "node build-v2-compat",
1818
"clean:background": "rimraf dist/background/background.js* dist/background/captureTab.js* dist/background/commands.js* dist/background/tmpClear.js*",
1919
"clean:content": "rimraf dist/content/content.js*",

0 commit comments

Comments
 (0)