-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrollup.config.js
More file actions
48 lines (46 loc) · 1.07 KB
/
rollup.config.js
File metadata and controls
48 lines (46 loc) · 1.07 KB
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
import typescript from 'rollup-plugin-typescript2';
import terser from '@rollup/plugin-terser';
import resolve from '@rollup/plugin-node-resolve';
const createConfig = (entry) => ({
input: `src/${entry}/index.ts`,
output: [
{
file: `dist/esm/${entry}/index.js`,
format: 'esm',
sourcemap: true,
},
{
file: `dist/esm/${entry}/index.min.js`,
format: 'esm',
sourcemap: true,
plugins: [terser()],
},
],
plugins: [
typescript({
tsconfig: './tsconfig.json',
useTsconfigDeclarationDir: true,
}),
resolve({ browser: true }),
],
treeshake: true,
});
export default [
createConfig('core'),
createConfig('web'),
{
input: 'src/web/RefreshWorker.ts',
output: {
file: 'dist/esm/web/RefreshWorker.js',
format: 'esm',
},
plugins: [
typescript({
tsconfig: './tsconfig.json',
// no need to generate declaration files for the worker
tsconfigOverride: { compilerOptions: { declaration: false } }
}),
resolve({ browser: true }),
],
},
];