1 | import path from 'path'
|
2 | import babel from 'rollup-plugin-babel'
|
3 | import resolve from 'rollup-plugin-node-resolve'
|
4 | import commonjs from 'rollup-plugin-commonjs'
|
5 | import { terser } from 'rollup-plugin-terser'
|
6 | import replace from '@rollup/plugin-replace'
|
7 |
|
8 | export default {
|
9 | input: path.resolve(__dirname, 'lib/index.js'),
|
10 | output: [
|
11 | {
|
12 | name: 'ReactDnDHTML5Backend',
|
13 | file: path.resolve(__dirname, 'dist/umd/ReactDnDHTML5Backend.js'),
|
14 | format: 'umd',
|
15 | plugins: [
|
16 | replace({
|
17 | values: { 'process.env.NODE_ENV': JSON.stringify('development') },
|
18 | delimiters: ['', ''],
|
19 | }),
|
20 | ],
|
21 | },
|
22 | {
|
23 | name: 'ReactDnDHTML5Backend',
|
24 | file: path.resolve(__dirname, 'dist/umd/ReactDnDHTML5Backend.min.js'),
|
25 | format: 'umd',
|
26 | plugins: [
|
27 | terser(),
|
28 | replace({
|
29 | values: { 'process.env.NODE_ENV': JSON.stringify('production') },
|
30 | delimiters: ['', ''],
|
31 | }),
|
32 | ],
|
33 | },
|
34 | ],
|
35 | external: ['react', 'react-dom', 'react-dnd'],
|
36 | globals: {
|
37 | react: 'React',
|
38 | 'react-dom': 'ReactDOM',
|
39 | 'react-dnd': 'ReactDnD',
|
40 | },
|
41 | plugins: [
|
42 | resolve(),
|
43 | commonjs(),
|
44 | babel({
|
45 | exclude: 'node_modules/**',
|
46 | presets: [
|
47 | [
|
48 | '@babel/env',
|
49 | {
|
50 | modules: 'false',
|
51 | corejs: '3.0.0',
|
52 | targets: {
|
53 | browsers: '> 0.25%, not dead',
|
54 | node: 8,
|
55 | ie: '11',
|
56 | },
|
57 | },
|
58 | ],
|
59 | ],
|
60 | }),
|
61 | ],
|
62 | }
|