generated from ChaseIngebritson/Cider-Plugin-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
45 lines (42 loc) · 1.02 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
import copy from 'rollup-plugin-copy'
import { babel } from '@rollup/plugin-babel';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import dotenv from 'dotenv';
dotenv.config()
const DEV = (process.env.NODE_ENV !== 'production')
const OUTPUT_DIR = (DEV && process.env.OUTPUT_DIR) ? process.env.OUTPUT_DIR : 'dist'
export default {
input: [
'src/index.js',
'src/index.frontend.js',
'src/components/concerts-vue.js'
],
output: {
dir: OUTPUT_DIR,
format: 'cjs'
},
external: ['path', 'fs', 'electron'],
plugins: [
commonjs(),
babel({ babelHelpers: 'bundled' }),
nodeResolve({
// use "jsnext:main" if possible
// see https://github.com/rollup/rollup/wiki/jsnext:main
'jsnext:main': true
}),
copy({
targets: [
{
src: [
'package.json',
'README.md',
'src/styles/*',
'src/assets'
],
dest: OUTPUT_DIR
}
]
})
]
}