-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollup.config.mjs
67 lines (61 loc) · 1.9 KB
/
rollup.config.mjs
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { nodeResolve } from '@rollup/plugin-node-resolve'
// import nodePolyfills from 'rollup-plugin-node-polyfills'
import commonjs from '@rollup/plugin-commonjs'
// import json from '@rollup/plugin-json'
import replace from '@rollup/plugin-replace'
import fs from 'fs'
const deps = fs.readdirSync('./app/src/deps')
export default [...deps.map((name) =>
({
// treeshake: true,
input: `./app/src/deps/${name}`,
output: {
file: `./app/build/deps/${name}`,
format: 'esm',
// compact: true,
// minifyInternalExports: true,
sourcemap: false
},
plugins: [
replace({
preventAssignment: false,
// include: ['**/deps/falcor.js'],
delimiters: ['', ''],
values: {
// FIXME: needs svelte patch and regresssion test!
"arg && typeof arg === 'object' && 'length' in arg": "arg && 'length' in arg",
'process.env.FALCOR_OBSERVABLE_NO_CATCH': 'false',
'setImmediate(throwError, e);': 'setTimeout(() => { throwError(e); }, 0);'
// 'setImmediate': '((cb, arg) => { setTimeout(() => { cb(arg) }, 0) })'
} // TODO: fix falcor and remove this
}),
nodeResolve({
preferBuiltins: false,
browser: true
}),
commonjs()
]
}))]
// {
// input: `./deps-node.js`,
// external: ['chokidar' ], // ,'fs', 'acorn', 'fsevents', 'path', , 'crypto', 'assert', 'stream', 'util', 'url', 'os'],
// output: {
// file: `./deps-node.build.js`,
// format: 'esm',
// sourcemap: false
// },
// plugins: [
// replace({
// preventAssignment: false,
// values: { "'chokidar'": "'./chokidar-stub.js'" } // TODO: fix falcor and remove this
// // // glob_1.Glob;
// }),
// json(),
// commonjs(),
// nodePolyfills(),
// nodeResolve({
// preferBuiltins: false,
// mainFields: ['browser', 'main']
// })
// ]
// }]