forked from PolymerLabs/arcs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
33 lines (31 loc) · 891 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
32
33
import resolve from 'rollup-plugin-node-resolve';
import multiEntry from 'rollup-plugin-multi-entry';
import ignore from 'rollup-plugin-ignore';
import pkg from './package.json';
import path from 'path';
export default {
input: ['runtime/ts-build/runtime.js', 'shell/apps/remote-planning/interface.js'],
output: [
{
file: pkg.module,
format: 'es',
}
],
external: [
...Object.keys(pkg.dependencies || {}),
...Object.keys(pkg.peerDependencies || {}),
],
plugins: [
ignore(['whatwg-fetch']),
{
resolveId: (importee, importer) => {
if (importee.includes('-web.js')) {
return path.resolve(path.dirname(importer), importee.replace('-web.js', '-node.js'));
}
// if nothing is returned, we fall back to default resolution
}
},
resolve({jsnext: true, modulesOnly: true}),
multiEntry()
]
};