-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollup.config.js
41 lines (38 loc) · 1.27 KB
/
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
32
33
34
35
36
37
38
39
40
41
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 { string } from 'rollup-plugin-string';
import markdown from '@jackfranklin/rollup-plugin-markdown';
import externalGlobals from "rollup-plugin-external-globals";
// You can have more root bundles by extending this array
const rootFiles = ['index.ts']
export default rootFiles.map(name => {
/** @type { import("rollup").RollupOptions } */
const options = {
input: `src/${name}`,
watch: {
include: 'src/**/*.ts',
},
external: ['typescript'],
output: {
paths: {
"typescript": "typescript-sandbox/index",
},
name,
dir: 'dist',
format: 'amd',
sourcemap: process.env.NODE_ENV === 'production' ? false : 'inline',
},
plugins: [
string({ include: '**/*.tpl'}),
markdown(),
typescript({ tsconfig: 'tsconfig.json' }, { exclude: ['**/*.ts.tpl']}),
externalGlobals({ typescript: "window.ts" }),
commonjs(),
node(),
json(),
],
}
return options;
});