-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
58 lines (56 loc) · 1.19 KB
/
Copy pathrollup.config.js
File metadata and controls
58 lines (56 loc) · 1.19 KB
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
50
51
52
53
54
55
56
57
58
import pkg from './package.json'
import babel from 'rollup-plugin-babel'
import uglify from 'rollup-plugin-uglify-es'
import commonjs from 'rollup-plugin-commonjs'
import resolve from 'rollup-plugin-node-resolve'
import json from 'rollup-plugin-json'
import replace from 'rollup-plugin-replace'
module.exports = [
{
input: 'src/index.js',
output: [
{
file: pkg.main,
format: 'cjs'
},
{
file: pkg.module,
format: 'es'
}
],
plugins: [
babel({
exclude: 'node_modules/**'
}),
uglify()
],
external: ['axios']
},
{
input: 'src/index.js',
output: [
{
file: 'dist/confit-client.iife.min.js',
format: 'iife',
name: 'Confit'
}
],
plugins: [
replace({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV) // for axios (https://github.com/axios/axios/commit/4d2f9c21d48f8370a16af9e0b890cd0ce137b158)
}),
babel({
exclude: 'node_modules/**'
}),
resolve({
browser: true,
main: true
}),
commonjs({
include: 'node_modules/**'
}),
json(),
uglify()
]
}
]