-
Notifications
You must be signed in to change notification settings - Fork 98
/
rollup.config.js
31 lines (29 loc) · 910 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 webWorkerLoader from 'rollup-plugin-web-worker-loader';
import { nodeResolve } from '@rollup/plugin-node-resolve';
function getConfig(entry, filename, perf) {
return {
input: entry,
output: {
file: `dist/${filename}`,
format: 'esm',
exports: 'named'
},
plugins: [
webWorkerLoader({
pattern: /.*\/worker\.js/,
targetPlatform: 'browser'
}),
nodeResolve({
extensions: (perf ? ['.dev.js'] : []).concat(['.js'])
})
]
};
}
export default [
getConfig('src/index.js', 'index.js'),
getConfig('src/memory/backend.js', 'memory-backend.js'),
getConfig('src/indexeddb/backend.js', 'indexeddb-backend.js'),
getConfig('src/indexeddb/main-thread.js', 'indexeddb-main-thread.js'),
getConfig('src/index.js', 'perf/index.js', true),
getConfig('src/indexeddb/main-thread.js', 'perf/indexeddb-main-thread.js', true),
];