-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrollup.js
63 lines (59 loc) · 1.29 KB
/
rollup.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**
* Dependencies
*/
const nodeResolve = require('@rollup/plugin-node-resolve'); // Locate modules using the Node resolution algorithm, for using third party modules in node_modules.
const replace = require('@rollup/plugin-replace'); // Replace content while bundling.
/**
* Base module configuration. Refer to the package for details on the available options.
*
* @source https://rollupjs.org
*
* @type {Object}
*/
const rollup = {
sourcemap: 'inline',
format: 'iife',
strict: true
};
/**
* Plugin configuration. Refer to the package for details on the available options.
*
* @source https://github.com/rollup/plugins
*
* @type {Object}
*/
let plugins = [
replace({
preventAssignment: true,
values: {
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
}
}),
nodeResolve.nodeResolve({
browser: true,
moduleDirectories: [
'node_modules'
]
})
];
/**
* ES Module Exports
*
* @type {Array}
*/
module.exports = [
{
input: `${process.env.PWD}/src/js/default.js`,
output: [
{
name: 'Default',
file: `${process.env.PWD}/dist/js/default.js`,
sourcemap: rollup.sourcemap,
format: rollup.format,
strict: rollup.strict
}
],
plugins: plugins,
devModule: true
}
];