-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrollup.config.js
30 lines (29 loc) · 934 Bytes
/
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
import resolve from 'rollup-plugin-node-resolve';
import json from 'rollup-plugin-json';
import babel from 'rollup-plugin-babel';
import eslint from 'rollup-plugin-eslint';
import replace from 'rollup-plugin-replace';
import uglify from 'rollup-plugin-uglify';
import { minify } from 'uglify-es';
import commonjs from 'rollup-plugin-commonjs';
export default {
input: 'src/gtag-tracker.js',
output: {
file: (process.env.BUILD === 'production' ? 'dist' : 'examples/assets') + '/gtag-tracker.js',
name: 'gtagTracker',
format: 'cjs'
},
plugins: [
resolve(),
json(),
commonjs(),
eslint(),
babel({
exclude: 'node_modules/**' // only transpile our source code
}),
replace({
ENV: JSON.stringify(process.env.BUILD || 'development'),
}),
(process.env.BUILD === 'production' && uglify({}, minify)),
]
};