-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
31 lines (27 loc) · 978 Bytes
/
rollup.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import typescript from "@rollup/plugin-typescript";
import node from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import json from "@rollup/plugin-json";
import ignore from "rollup-plugin-ignore";
// You can have more root bundles by extending this array
const rootFiles = ["index.ts"];
import externalGlobals from "rollup-plugin-external-globals";
export default rootFiles.map(name => {
/** @type { import("rollup").RollupOptions } */
const options = {
input: `src/${name}`,
external: ['typescript', 'fs', 'path'],
output: {
paths: {
"typescript":"typescript-sandbox/index",
"fs":"typescript-sandbox/index",
"path":"typescript-sandbox/index",
},
name,
dir: "dist",
format: "amd"
},
plugins: [typescript({ tsconfig: "tsconfig.json" }), externalGlobals({ typescript: "window.ts" }), ignore(["path", "fs"]), commonjs(), node(), json()]
};
return options;
});