wallet-core/packages/taler-wallet-webextension/rollup.config.js

99 lines
1.8 KiB
JavaScript
Raw Normal View History

2019-12-02 18:12:59 +01:00
// rollup.config.js
import commonjs from "@rollup/plugin-commonjs";
import nodeResolve from "@rollup/plugin-node-resolve";
import json from "@rollup/plugin-json";
import builtins from "builtin-modules";
2020-08-10 18:49:23 +02:00
import replace from "@rollup/plugin-replace";
import ignore from "rollup-plugin-ignore"
2019-12-16 16:59:09 +01:00
const webExtensionPageEntryPoint = {
2020-08-10 18:49:23 +02:00
input: "lib/pageEntryPoint.js",
output: {
2020-08-10 18:49:23 +02:00
file: "dist/pageEntryPoint.js",
format: "iife",
exports: "none",
name: "webExtensionPageEntry",
},
plugins: [
2019-12-16 16:59:09 +01:00
json(),
2020-08-10 18:49:23 +02:00
ignore(builtins),
nodeResolve({
2020-08-10 18:49:23 +02:00
browser: true,
}),
2020-08-10 18:49:23 +02:00
//terser(),
replace({
"process.env.NODE_ENV": JSON.stringify("production"),
2020-08-10 18:49:23 +02:00
"__filename": "'__webextension__'",
}),
2020-08-10 18:49:23 +02:00
commonjs(),
],
2019-12-02 18:12:59 +01:00
};
const webExtensionBackgroundPageScript = {
2020-08-10 18:49:23 +02:00
input: "lib/background.js",
2019-12-05 19:38:19 +01:00
output: {
2020-08-10 18:49:23 +02:00
file: "dist/background.js",
format: "iife",
exports: "none",
name: "webExtensionBackgroundScript",
2019-12-05 19:38:19 +01:00
},
plugins: [
json(),
2020-08-10 18:49:23 +02:00
ignore(builtins),
2019-12-05 19:38:19 +01:00
nodeResolve({
2020-08-10 18:49:23 +02:00
browser: true,
}),
2020-08-10 18:49:23 +02:00
//terser(),
replace({
"process.env.NODE_ENV": JSON.stringify("production"),
2020-08-10 18:49:23 +02:00
"__filename": "'__webextension__'",
2019-12-05 19:38:19 +01:00
}),
2020-08-10 18:49:23 +02:00
commonjs()
],
};
const webExtensionCryptoWorker = {
2020-08-10 18:49:23 +02:00
input: "lib/browserWorkerEntry.js",
output: {
2020-08-10 18:49:23 +02:00
file: "dist/browserWorkerEntry.js",
format: "iife",
exports: "none",
name: "webExtensionCryptoWorker",
},
plugins: [
json(),
2020-08-10 18:49:23 +02:00
ignore(builtins),
nodeResolve({
2020-08-10 18:49:23 +02:00
browser: true,
}),
2020-08-10 18:49:23 +02:00
//terser(),
replace({
"process.env.NODE_ENV": JSON.stringify("production"),
2020-08-10 18:49:23 +02:00
"__filename": "'__webextension__'",
}),
2020-08-10 18:49:23 +02:00
commonjs(),
],
};
export default [
webExtensionPageEntryPoint,
webExtensionBackgroundPageScript,
webExtensionCryptoWorker,
];