fix module bundling config
This commit is contained in:
parent
ef636c022b
commit
4b16d7bd34
@ -6,6 +6,31 @@ import builtins from "builtin-modules";
|
||||
import replace from "@rollup/plugin-replace";
|
||||
import ignore from "rollup-plugin-ignore"
|
||||
|
||||
const makePlugins = () => [
|
||||
ignore(["module", "os"]),
|
||||
nodeResolve({
|
||||
browser: true,
|
||||
preferBuiltins: true,
|
||||
}),
|
||||
|
||||
//terser(),
|
||||
|
||||
|
||||
replace({
|
||||
"process.env.NODE_ENV": JSON.stringify("production"),
|
||||
"__filename": "'__webextension__'",
|
||||
}),
|
||||
|
||||
commonjs({
|
||||
include: [/node_modules/, /dist/],
|
||||
extensions: [".js"],
|
||||
ignoreGlobal: true,
|
||||
sourceMap: true,
|
||||
}),
|
||||
|
||||
json(),
|
||||
];
|
||||
|
||||
|
||||
const webExtensionPageEntryPoint = {
|
||||
input: "lib/pageEntryPoint.js",
|
||||
@ -15,24 +40,7 @@ const webExtensionPageEntryPoint = {
|
||||
exports: "none",
|
||||
name: "webExtensionPageEntry",
|
||||
},
|
||||
plugins: [
|
||||
json(),
|
||||
|
||||
ignore(builtins),
|
||||
|
||||
nodeResolve({
|
||||
browser: true,
|
||||
}),
|
||||
|
||||
//terser(),
|
||||
|
||||
replace({
|
||||
"process.env.NODE_ENV": JSON.stringify("production"),
|
||||
"__filename": "'__webextension__'",
|
||||
}),
|
||||
|
||||
commonjs(),
|
||||
],
|
||||
plugins: makePlugins(),
|
||||
};
|
||||
|
||||
const webExtensionBackgroundPageScript = {
|
||||
@ -43,24 +51,7 @@ const webExtensionBackgroundPageScript = {
|
||||
exports: "none",
|
||||
name: "webExtensionBackgroundScript",
|
||||
},
|
||||
plugins: [
|
||||
json(),
|
||||
|
||||
ignore(builtins),
|
||||
|
||||
nodeResolve({
|
||||
browser: true,
|
||||
}),
|
||||
|
||||
//terser(),
|
||||
|
||||
replace({
|
||||
"process.env.NODE_ENV": JSON.stringify("production"),
|
||||
"__filename": "'__webextension__'",
|
||||
}),
|
||||
|
||||
commonjs()
|
||||
],
|
||||
plugins: makePlugins(),
|
||||
};
|
||||
|
||||
const webExtensionCryptoWorker = {
|
||||
@ -71,24 +62,7 @@ const webExtensionCryptoWorker = {
|
||||
exports: "none",
|
||||
name: "webExtensionCryptoWorker",
|
||||
},
|
||||
plugins: [
|
||||
json(),
|
||||
|
||||
ignore(builtins),
|
||||
|
||||
nodeResolve({
|
||||
browser: true,
|
||||
}),
|
||||
|
||||
//terser(),
|
||||
|
||||
replace({
|
||||
"process.env.NODE_ENV": JSON.stringify("production"),
|
||||
"__filename": "'__webextension__'",
|
||||
}),
|
||||
|
||||
commonjs(),
|
||||
],
|
||||
plugins: makePlugins(),
|
||||
};
|
||||
|
||||
export default [
|
||||
|
@ -21,4 +21,4 @@
|
||||
/**
|
||||
* Imports.
|
||||
*/
|
||||
export { strings } from "./strings";
|
||||
export { strings } from "./strings.js";
|
||||
|
@ -22,8 +22,8 @@
|
||||
|
||||
import { render } from "preact";
|
||||
import { setupI18n } from "@gnu-taler/taler-util";
|
||||
import { strings } from "./i18n"
|
||||
import { Application } from './Application';
|
||||
import { strings } from "./i18n/strings";
|
||||
import { Application } from "./Application";
|
||||
|
||||
function main(): void {
|
||||
try {
|
||||
|
@ -46,7 +46,6 @@ importers:
|
||||
'@types/node': ^14.14.22
|
||||
ava: ^3.15.0
|
||||
esbuild: ^0.9.2
|
||||
esm: ^3.2.25
|
||||
jed: ^1.1.1
|
||||
prettier: ^2.2.1
|
||||
rimraf: ^3.0.2
|
||||
@ -59,7 +58,6 @@ importers:
|
||||
'@types/node': 14.14.34
|
||||
ava: 3.15.0
|
||||
esbuild: 0.9.2
|
||||
esm: 3.2.25
|
||||
prettier: 2.2.1
|
||||
rimraf: 3.0.2
|
||||
typescript: 4.2.3
|
||||
@ -159,7 +157,6 @@ importers:
|
||||
eslint-plugin-jsx-a11y: ^6.4.1
|
||||
eslint-plugin-react: ^7.22.0
|
||||
eslint-plugin-react-hooks: ^4.2.0
|
||||
esm: ^3.2.25
|
||||
fflate: ^0.6.0
|
||||
jed: ^1.1.1
|
||||
nyc: ^15.1.0
|
||||
@ -195,7 +192,6 @@ importers:
|
||||
eslint-plugin-jsx-a11y: 6.4.1_eslint@7.18.0
|
||||
eslint-plugin-react: 7.22.0_eslint@7.18.0
|
||||
eslint-plugin-react-hooks: 4.2.0_eslint@7.18.0
|
||||
esm: 3.2.25
|
||||
jed: 1.1.1
|
||||
nyc: 15.1.0
|
||||
po2json: 0.4.5
|
||||
@ -6165,7 +6161,7 @@ packages:
|
||||
/axios/0.21.1:
|
||||
resolution: {integrity: sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==}
|
||||
dependencies:
|
||||
follow-redirects: 1.14.0
|
||||
follow-redirects: 1.14.0_debug@4.3.1
|
||||
transitivePeerDependencies:
|
||||
- debug
|
||||
|
||||
@ -9660,15 +9656,6 @@ packages:
|
||||
readable-stream: 2.3.7
|
||||
dev: true
|
||||
|
||||
/follow-redirects/1.14.0:
|
||||
resolution: {integrity: sha512-0vRwd7RKQBTt+mgu87mtYeofLFZpTas2S9zY+jIeuLJMNvudIgF52nr19q40HOwH5RrhWIPuj9puybzSJiRrVg==}
|
||||
engines: {node: '>=4.0'}
|
||||
peerDependencies:
|
||||
debug: '*'
|
||||
peerDependenciesMeta:
|
||||
debug:
|
||||
optional: true
|
||||
|
||||
/follow-redirects/1.14.0_debug@4.3.1:
|
||||
resolution: {integrity: sha512-0vRwd7RKQBTt+mgu87mtYeofLFZpTas2S9zY+jIeuLJMNvudIgF52nr19q40HOwH5RrhWIPuj9puybzSJiRrVg==}
|
||||
engines: {node: '>=4.0'}
|
||||
@ -9679,7 +9666,6 @@ packages:
|
||||
optional: true
|
||||
dependencies:
|
||||
debug: 4.3.1_supports-color@6.1.0
|
||||
dev: true
|
||||
|
||||
/for-each/0.3.3:
|
||||
resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==}
|
||||
@ -13250,6 +13236,7 @@ packages:
|
||||
|
||||
/nodent-compiler/3.2.13:
|
||||
resolution: {integrity: sha512-nzzWPXZwSdsWie34om+4dLrT/5l1nT/+ig1v06xuSgMtieJVAnMQFuZihUwREM+M7dFso9YoHfDmweexEXXrrw==}
|
||||
engines: {'0': n, '1': o, '2': d, '3': e, '4': ' ', '5': '>', '6': '=', '7': ' ', '8': '0', '9': ., '10': '1', '11': '0', '12': ., '13': '0'}
|
||||
dependencies:
|
||||
acorn: 5.7.4
|
||||
acorn-es7-plugin: 1.1.7
|
||||
|
Loading…
Reference in New Issue
Block a user