-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
32 lines (30 loc) · 836 Bytes
/
Copy pathrollup.config.js
File metadata and controls
32 lines (30 loc) · 836 Bytes
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
import resolve, {nodeResolve} from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
export default {
input: 'index.js', // your main file
output: {
file: 'dist/bundle.js', // bundled output
format: 'cjs', // commonjs (for Node.js apps)
},
plugins: [
resolve({
preferBuiltins: true, // if importing 'fs', 'path' etc, prefer node built-in
}),
nodeResolve({
jsnext: true
}),
commonjs({
include: [ "./index.js", "node_modules/**" ],
ignoreGlobal: false, // Default: false
// if false then skip sourceMap generation for CommonJS modules
sourceMap: false // Default: true
}),
],
external: [
'fs',
'fs/promises',
'path',
'url',
/node_modules/
], // (you can add 'fs', 'path' here if needed)
};