UNPKG

931 BJavaScriptView Raw
1import nodeResolve from '@rollup/plugin-node-resolve';
2import babel from '@rollup/plugin-babel';
3import commonjs from '@rollup/plugin-commonjs';
4import { terser } from "rollup-plugin-terser";
5
6export default {
7 input: 'src/Recoil.js',
8 output: {
9 file: 'recoil.js',
10 format: 'cjs',
11 },
12 plugins: [
13 babel({
14 "presets": [
15 "@babel/preset-react",
16 "@babel/preset-flow"
17 ],
18 "plugins": [
19 '@babel/plugin-proposal-nullish-coalescing-operator',
20 '@babel/plugin-proposal-optional-chaining',
21 '@babel/plugin-proposal-class-properties'
22 ]
23 }),
24 {
25 resolveId: (source) => {
26 if (source === 'React') {
27 return {id: 'react', external: true};
28 }
29 if (source === 'ReactDOM') {
30 return {id: 'react-dom', external: true};
31 }
32 return null;
33 }
34 },
35 nodeResolve(),
36 commonjs(),
37 // terser(),
38 ],
39};