-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
47 lines (44 loc) · 1.34 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
46
47
const livescript = require('rollup-plugin-livescript');
import commonjs from '@rollup/plugin-commonjs';
import builtins from 'rollup-plugin-node-builtins';
import resolve from '@rollup/plugin-node-resolve';
import includePaths from 'rollup-plugin-includepaths';
const builtinModules = require('builtin-modules');
import json from '@rollup/plugin-json';
var paths = process.env.NODE_PATH.split( /[:;]/ ).filter(x => x.length > 0)
let includePathOptions = {
include: {},
paths: paths,
external: builtinModules,
extensions: ['.js', '.json', '.ls']
};
export default {
output: {
//sourcemap: "inline", <- decided via command line arguments
format: 'cjs',
exports: "auto"
},
plugins: [
includePaths(includePathOptions),
livescript(),
json(),
// commonjs before bultins
commonjs({
extensions: ['.js', '.ls'],
}), // import commonjs from 'rollup-plugin-commonjs';
builtins(), // import builtins from 'rollup-plugin-node-builtins';
resolve({
extensions: ['.js', '.ls']
}),
{
transform ( code, id ) {
// Debug the Rollup Config:
// ------------------------
//console.log("paths: ", paths);
//console.log(builtinModules);
// ------------------------
// not returning anything, so doesn't affect bundle
}
}
]
};