Open History to see the last commit
1import babel from 'rollup-plugin-babel'
2import { terser } from 'rollup-plugin-terser'
3import size from 'rollup-plugin-size'
4import externalDeps from 'rollup-plugin-peer-deps-external'
5import resolve from 'rollup-plugin-node-resolve'
6import commonJS from 'rollup-plugin-commonjs'
7import visualizer from 'rollup-plugin-visualizer'
8import replace from '@rollup/plugin-replace'
9β
10const external = ['react']
11β
12const globals = {
13 react: 'React',
14}
15β
16export default [
17 {
18 input: 'src/index.js',
19 output: {
20 file: 'dist/react-location.mjs',
21 format: 'es',
22 sourcemap: true,
23 },
24 external,
25 plugins: [resolve(), babel(), commonJS(), externalDeps()],
26 },
27 {
28 input: 'src/index.js',
29 output: {
30 file: 'dist/react-location.min.mjs',
31 format: 'es',
32 sourcemap: true,
33 },
34 external,
35 plugins: [resolve(), babel(), commonJS(), externalDeps(), terser()],
36 },
37 {
38 input: 'src/index.js',
39 output: {
40 name: 'ReactLocation',
41 file: 'dist/react-location.development.js',
42 format: 'umd',
43 sourcemap: true,
44 globals,
45 },
46 external,
47 plugins: [resolve(), babel(), commonJS(), externalDeps()],
48 },
49 {
50 input: 'src/index.js',
51 output: {
52 name: 'ReactLocation',
53 file: 'dist/react-location.production.min.js',
54 format: 'umd',
55 sourcemap: true,
56 globals,
57 },
58 external,
59 plugins: [
60 replace({ 'process.env.NODE_ENV': `"production"`, delimiters: ['', ''] }),
61 resolve(),
62 babel(),
63 commonJS(),
64 externalDeps(),
65 terser(),
66 size(),
67 visualizer(),
68 ],
69 },
70]