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

43 lines
1.1 KiB
JavaScript
Raw Normal View History

// 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";
import pkg from "./package.json";
import sourcemaps from "rollup-plugin-sourcemaps";
import path from "path";
export default {
input: "lib/index.js",
output: {
file: pkg.main,
format: "cjs",
2020-08-27 10:52:47 +02:00
sourcemap: true,
sourcemapPathTransform: (relativeSourcePath, sourcemapPath) => {
// Transform to source map paths to virtual path. Otherwise,
// error messages would contain paths that look like they should exist (relative to
// the bundle) but don't.
const res = path.normalize(
path.join("/_walletsrc/packages/taler-wallet-cli/src/", relativeSourcePath),
);
return res;
},
},
external: builtins,
plugins: [
nodeResolve({
preferBuiltins: true,
exportConditions: ["node"],
}),
2020-08-27 10:52:47 +02:00
sourcemaps(),
2020-08-06 17:36:56 +02:00
commonjs({
2020-08-27 10:52:47 +02:00
sourceMap: true,
2020-08-06 17:36:56 +02:00
transformMixedEsModules: true,
}),
2020-08-27 10:52:47 +02:00
json(),
],
};