forked from oct16/TimeCat
-
Notifications
You must be signed in to change notification settings - Fork 3
/
rollup.config.prod.js
45 lines (43 loc) · 1.11 KB
/
rollup.config.prod.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
42
43
44
45
import ts from 'rollup-plugin-typescript2'
import html from '@rollup/plugin-html'
import node from 'rollup-plugin-node-resolve'
import sourcemaps from 'rollup-plugin-sourcemaps'
import { terser } from 'rollup-plugin-terser'
import fs from 'fs'
import { string } from 'rollup-plugin-string'
export default {
input: 'index.ts',
output: [
{
name: 'wr',
format: 'cjs',
file: 'dist/replay.cjs.js',
sourcemap: true
},
{
name: 'wr',
format: 'esm',
file: 'dist/replay.esm.js',
sourcemap: true
}
],
plugins: [
ts(),
node({
mainFields: ['module', 'main']
}),
sourcemaps(),
html({
template: () => fs.readFileSync('examples/todo.html')
}),
html({
fileName: 'replay.html',
template: () => fs.readFileSync('assets/template.html')
}),
string({
include: ['**/*.html', '**/*.css'],
exclude: ['**/index.html', '**/index.css']
}),
terser()
]
}