forked from brandly/react-tetris
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.lib.js
33 lines (32 loc) · 868 Bytes
/
rollup.lib.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
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import babel from 'rollup-plugin-babel';
import builtins from 'rollup-plugin-node-builtins';
import globals from 'rollup-plugin-node-globals';
import typescript from '@rollup/plugin-typescript';
import replace from '@rollup/plugin-replace';
export default {
input: 'src/js/components/tetris.tsx',
output: {
file: 'lib/index.js',
format: 'cjs'
},
external: ['react', 'react-dom'],
plugins: [
replace({ 'process.env.NODE_ENV': JSON.stringify('development') }),
typescript(),
babel({
exclude: 'node_modules/**',
plugins: ['@babel/plugin-external-helpers']
}),
resolve({
browser: true,
preferBuiltins: true
}),
commonjs({
ignore: ['react', 'react-dom']
}),
globals(),
builtins()
]
};