-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bundle webextension-polyfill via webpack
requires another patch to @webextension-toolbox/webextension-toolbox due to default config file path not resolving with find-up (sindresorhus/find-up#36 (comment))
- Loading branch information
Showing
6 changed files
with
77 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...s/@webextension-toolbox+webextension-toolbox+6.2.0+001+fix default config file path.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
diff --git a/node_modules/@webextension-toolbox/webextension-toolbox/dist/command.js b/node_modules/@webextension-toolbox/webextension-toolbox/dist/command.js | ||
index 260881b..a83e1b4 100644 | ||
--- a/node_modules/@webextension-toolbox/webextension-toolbox/dist/command.js | ||
+++ b/node_modules/@webextension-toolbox/webextension-toolbox/dist/command.js | ||
@@ -24,7 +24,7 @@ const index_1 = require("./index"); | ||
.command("dev") | ||
.description("Compiles extension in devmode") | ||
.argument("<vendor>", "The Vendor to compile") | ||
- .option("-c, --config [config]", "specify config file path", "./webextension-toolbox.config.js") | ||
+ .option("-c, --config [config]", "specify config file path", "webextension-toolbox.config.js") | ||
.option("-s, --src [src]", "specify source directory", "app") | ||
.option("-t, --target [target]", "specify target directory", "dist/[vendor]") | ||
.option("-d, --devtool [string | false]", "controls if and how source maps are generated", "cheap-source-map") | ||
@@ -39,7 +39,7 @@ const index_1 = require("./index"); | ||
.command("build") | ||
.description("Compiles extension for production") | ||
.argument("<vendor>", "The Vendor to compile") | ||
- .option("-c, --config [config]", "specify config file path", "./webextension-toolbox.config.js") | ||
+ .option("-c, --config [config]", "specify config file path", "webextension-toolbox.config.js") | ||
.option("-s, --src [src]", "specify source directory", "app") | ||
.option("-t, --target [target]", "specify target directory", "dist/[vendor]") | ||
.option("-d, --devtool [string | false]", "controls if and how source maps are generated", false) | ||
diff --git a/node_modules/@webextension-toolbox/webextension-toolbox/src/command.ts b/node_modules/@webextension-toolbox/webextension-toolbox/src/command.ts | ||
index 2ea3bec..ce4dcc9 100644 | ||
--- a/node_modules/@webextension-toolbox/webextension-toolbox/src/command.ts | ||
+++ b/node_modules/@webextension-toolbox/webextension-toolbox/src/command.ts | ||
@@ -30,7 +30,7 @@ import { build, dev } from "./index"; | ||
.option( | ||
"-c, --config [config]", | ||
"specify config file path", | ||
- "./webextension-toolbox.config.js" | ||
+ "webextension-toolbox.config.js" | ||
) | ||
.option("-s, --src [src]", "specify source directory", "app") | ||
.option( | ||
@@ -76,7 +76,7 @@ import { build, dev } from "./index"; | ||
.option( | ||
"-c, --config [config]", | ||
"specify config file path", | ||
- "./webextension-toolbox.config.js" | ||
+ "webextension-toolbox.config.js" | ||
) | ||
.option("-s, --src [src]", "specify source directory", "app") | ||
.option( |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
var webpack = require("webpack"); | ||
|
||
module.exports = { | ||
webpack: (config, { vendor }) => { | ||
if (["chrome", "opera", "edge"].includes(vendor)) { | ||
config.plugins.push( | ||
new webpack.ProvidePlugin({ | ||
browser: "webextension-polyfill", | ||
}), | ||
); | ||
} | ||
|
||
return config; | ||
}, | ||
}; |