-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.mjs
40 lines (39 loc) · 1.02 KB
/
rollup.config.mjs
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
import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import babel from '@rollup/plugin-babel'
import json from '@rollup/plugin-json'
import terser from '@rollup/plugin-terser'
import polyfillNode from 'rollup-plugin-polyfill-node'
export default {
input: 'src/js-ast-tokenizer.js',
output: [
{
file: 'dist/bundle.cjs.js',
format: 'cjs',
sourcemap: true,
},
{
file: 'dist/bundle.esm.js',
format: 'esm',
sourcemap: true,
},
{
file: 'dist/bundle.umd.js',
format: 'umd',
name: 'js-ast-tokenizer',
sourcemap: true,
plugins: [terser()],
},
],
plugins: [resolve(), commonjs(), json(), polyfillNode(), babel({ babelHelpers: 'bundled' })],
onwarn: (warning, warn) => {
if (
warning.code === 'CIRCULAR_DEPENDENCY' ||
warning.code === 'MISSING_GLOBAL_NAME' ||
warning.code === 'MISSING_SHIM'
) {
return
}
warn(warning)
},
}