This repository has been archived by the owner on Nov 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrollup.config.js
executable file
·58 lines (57 loc) · 1.61 KB
/
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
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
import commonjs from 'rollup-plugin-commonjs'
import nodeResolve from 'rollup-plugin-node-resolve'
import typescript from 'rollup-plugin-typescript2'
import tsc from 'typescript'
import uglify from 'rollup-plugin-uglify'
import { minify } from 'uglify-es'
import execute from 'rollup-plugin-execute'
export default {
input: 'src/asyncmachine.ts',
plugins: [
typescript({
check: false,
tsconfigDefaults: {
target: 'es5',
isolatedModules: true,
module: 'es6'
},
typescript: tsc
}),
nodeResolve({
jsnext: true,
main: true,
preferBuiltins: false
}),
commonjs({
include: 'node_modules/**',
ignoreGlobal: true
}),
uglify({}, minify),
// dirty dirty dirty
// propagate @ts-ignore statements to the generated definitions
execute([
`./node_modules/.bin/replace-in-file " on(" "// @ts-ignore
/**/on(" build/asyncmachine.d.ts`,
`./node_modules/.bin/replace-in-file " on: " "// @ts-ignore
/**/on: " build/asyncmachine.d.ts`,
`./node_modules/.bin/replace-in-file " once: " "// @ts-ignore
/**/once: " build/asyncmachine.d.ts`,
`./node_modules/.bin/replace-in-file " once(" "// @ts-ignore
/**/once(" build/asyncmachine.d.ts`,
`./node_modules/.bin/replace-in-file " emit: " "// @ts-ignore
/**/emit: " build/asyncmachine.d.ts`,
])
],
exports: 'named',
sourcemap: true,
output: [
{
file: 'build/asyncmachine.cjs.js',
format: 'cjs' },
{
file: 'build/asyncmachine.umd.js',
name: 'asyncmachine',
format: 'umd'
}
]
};