forked from riatelab/regioviz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
49 lines (48 loc) · 1.2 KB
/
rollup.config.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import babel from 'rollup-plugin-babel';
import commonjs from 'rollup-plugin-commonjs';
import eslint from 'rollup-plugin-eslint';
import resolve from 'rollup-plugin-node-resolve';
import replace from 'rollup-plugin-replace';
import uglify from 'rollup-plugin-uglify';
import serve from 'rollup-plugin-serve';
import postcss from 'rollup-plugin-postcss';
import autoprefixer from 'autoprefixer';
export default {
input: 'src/scripts/main.js',
output: {
file: 'build/js/main.min.js',
format: 'iife',
name: 'App',
sourcemap: 'inline',
},
plugins: [
resolve({
jsnext: true,
main: true,
browser: true,
}),
commonjs(),
eslint({
exclude: [
'src/styles/**',
],
}),
postcss({
plugins: [autoprefixer()], // [autoprefixer(), cssnano()],
sourceMap: 'inline',
extensions: ['.css'],
}),
babel({
exclude: 'node_modules/**',
}),
replace({
exclude: 'node_modules/**',
ENV: JSON.stringify(process.env.NODE_ENV || 'development'),
}),
(process.env.SERVE !== undefined && serve({
port: 11111,
contentBase: 'build',
})),
(process.env.NODE_ENV === 'production' && uglify()),
],
};