aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/rollup.config.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-08-10 22:19:23 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-08-10 22:19:23 +0530
commit172a51a43a5cfebd06876206ec3a0cd75ad86e43 (patch)
tree1f26963f69955c0dc1018ce2c3f6409f18e45676 /packages/taler-wallet-webextension/rollup.config.js
parentc2dcad8efeb7948a98997053a8e26087b40bacf8 (diff)
towards webextension working again
Diffstat (limited to 'packages/taler-wallet-webextension/rollup.config.js')
-rw-r--r--packages/taler-wallet-webextension/rollup.config.js166
1 files changed, 26 insertions, 140 deletions
diff --git a/packages/taler-wallet-webextension/rollup.config.js b/packages/taler-wallet-webextension/rollup.config.js
index 25ce768b4..6f2d84509 100644
--- a/packages/taler-wallet-webextension/rollup.config.js
+++ b/packages/taler-wallet-webextension/rollup.config.js
@@ -2,210 +2,96 @@
import commonjs from "@rollup/plugin-commonjs";
import nodeResolve from "@rollup/plugin-node-resolve";
import json from "@rollup/plugin-json";
-import replace from "@rollup/plugin-replace";
import builtins from "builtin-modules";
-import { terser } from "rollup-plugin-terser";
-import typescript from "@rollup/plugin-typescript";
-
-// Base settings to use
-const baseTypescriptCompilerSettings = {
- target: "ES6",
- jsx: "react",
- reactNamespace: "React",
- moduleResolution: "node",
- sourceMap: true,
- lib: ["es6", "dom"],
- noImplicitReturns: true,
- noFallthroughCasesInSwitch: true,
- strict: true,
- strictPropertyInitialization: false,
- noImplicitAny: true,
- noImplicitThis: true,
- allowJs: true,
- checkJs: true,
- incremental: false,
- esModuleInterop: true,
- importHelpers: true,
- module: "ESNext",
- include: ["src/**/*.+(ts|tsx)"],
- rootDir: "./src",
-};
-
-const walletCli = {
- input: "src/headless/taler-wallet-cli.ts",
- output: {
- file: "dist/standalone/taler-wallet-cli.js",
- format: "cjs",
- },
- external: builtins,
- plugins: [
- nodeResolve({
- preferBuiltins: true,
- }),
-
- commonjs({
- include: ["node_modules/**", "dist/node/**"],
- extensions: [".js", ".ts"],
- ignoreGlobal: false, // Default: false
- sourceMap: false,
- ignore: ["taler-wallet"],
- }),
-
- json(),
-
- typescript({
- tsconfig: false,
- ...baseTypescriptCompilerSettings,
- sourceMap: false,
- }),
- ],
-};
-
-const walletAndroid = {
- input: "src/android/index.ts",
- output: {
- //dir: "dist/standalone",
- file: "dist/standalone/taler-wallet-android.js",
- format: "cjs",
- exports: "named",
- },
- external: builtins,
- plugins: [
- json(),
-
- nodeResolve({
- preferBuiltins: true,
- }),
-
- commonjs({
- include: ["node_modules/**"],
- extensions: [".js"],
- sourceMap: false,
- ignore: ["taler-wallet"],
- }),
+import replace from "@rollup/plugin-replace";
+import ignore from "rollup-plugin-ignore"
- typescript({
- tsconfig: false,
- ...baseTypescriptCompilerSettings,
- sourceMap: false,
- }),
- ],
-};
const webExtensionPageEntryPoint = {
- input: "src/webex/pageEntryPoint.ts",
+ input: "lib/pageEntryPoint.js",
output: {
- file: "dist/webextension/pageEntryPoint.js",
+ file: "dist/pageEntryPoint.js",
format: "iife",
exports: "none",
name: "webExtensionPageEntry",
},
- external: builtins,
plugins: [
json(),
+ ignore(builtins),
+
nodeResolve({
- preferBuiltins: true,
+ browser: true,
}),
- terser(),
+ //terser(),
replace({
"process.env.NODE_ENV": JSON.stringify("production"),
+ "__filename": "'__webextension__'",
}),
- commonjs({
- include: ["node_modules/**", "dist/node/**"],
- extensions: [".js"],
- sourceMap: false,
- ignore: ["taler-wallet"],
- }),
-
- typescript({
- tsconfig: false,
- ...baseTypescriptCompilerSettings,
- sourceMap: false,
- }),
+ commonjs(),
],
};
const webExtensionBackgroundPageScript = {
- input: "src/webex/background.ts",
+ input: "lib/background.js",
output: {
- file: "dist/webextension/background.js",
+ file: "dist/background.js",
format: "iife",
exports: "none",
name: "webExtensionBackgroundScript",
},
- external: builtins,
plugins: [
json(),
+ ignore(builtins),
+
nodeResolve({
- preferBuiltins: true,
+ browser: true,
}),
- terser(),
+ //terser(),
replace({
"process.env.NODE_ENV": JSON.stringify("production"),
+ "__filename": "'__webextension__'",
}),
- commonjs({
- include: ["node_modules/**", "dist/node/**"],
- extensions: [".js"],
- sourceMap: false,
- ignore: ["taler-wallet", "crypto"],
- }),
-
- typescript({
- tsconfig: false,
- ...baseTypescriptCompilerSettings,
- sourceMap: false,
- }),
+ commonjs()
],
};
const webExtensionCryptoWorker = {
- input: "src/crypto/workers/browserWorkerEntry.ts",
+ input: "lib/browserWorkerEntry.js",
output: {
- file: "dist/webextension/browserWorkerEntry.js",
+ file: "dist/browserWorkerEntry.js",
format: "iife",
exports: "none",
name: "webExtensionCryptoWorker",
},
- external: builtins,
plugins: [
json(),
+ ignore(builtins),
+
nodeResolve({
- preferBuiltins: true,
+ browser: true,
}),
- terser(),
+ //terser(),
replace({
"process.env.NODE_ENV": JSON.stringify("production"),
+ "__filename": "'__webextension__'",
}),
- commonjs({
- include: ["node_modules/**", "dist/node/**"],
- extensions: [".js"],
- sourceMap: false,
- ignore: ["taler-wallet", "crypto"],
- }),
-
- typescript({
- tsconfig: false,
- ...baseTypescriptCompilerSettings,
- sourceMap: false,
- }),
+ commonjs(),
],
};
export default [
- walletCli,
- walletAndroid,
webExtensionPageEntryPoint,
webExtensionBackgroundPageScript,
webExtensionCryptoWorker,