-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
49 lines (46 loc) · 1.16 KB
/
rollup.config.js
File metadata and controls
49 lines (46 loc) · 1.16 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
import dotenv from 'dotenv';
import { argv } from 'yargs';
import url from 'rollup-plugin-url';
import json from 'rollup-plugin-json';
import commonjs from 'rollup-plugin-commonjs';
import cleanup from 'rollup-plugin-cleanup';
import replace from 'rollup-plugin-replace';
import nodeResolve from 'rollup-plugin-node-resolve';
import includePaths from 'rollup-plugin-includepaths';
import { terser } from 'rollup-plugin-terser';
const environment = Object.assign({}, dotenv.config().parsed, {
NODE_ENV: (argv.environment || 'development'),
});
export default {
output: {
format: 'cjs',
},
external: ['electron', 'electron-is-dev', 'fs', 'path'],
plugins: [
cleanup(),
replace({
'process.env': JSON.stringify(environment),
}),
includePaths({
include: {
appConfig: `${__dirname}/public/config.js`,
},
paths: ['public', 'dest'],
extensions: ['.json', '.js', '.html']
}),
nodeResolve(),
url(),
json({
include: [
'dest/**',
'node_modules/**',
],
preferConst: true,
indent: ' ',
compact: true,
namedExports: true,
}),
commonjs(),
terser(),
],
}