-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.main.config.mjs
29 lines (28 loc) · 951 Bytes
/
rollup.main.config.mjs
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
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
import { terser } from 'rollup-plugin-terser';
export default {
input: 'main.js', // Your main process entry file
output: {
inlineDynamicImports: true,
file: 'rollup/main.js', // Output bundle location
format: 'cjs', // CommonJS, suitable for Node.js and Electron
sourcemap: false // Optional: include source maps
},
// Externalize app dependencies. This makes the build faster
// and prevents bundling of modules you want to load natively from Node.js
external: [
'electron'
// You can include other external modules that you don't want to bundle
// for example: 'electron-updater'
],
plugins: [
resolve({
preferBuiltins: true,
}),
commonjs(),
json(),
terser() // Use terser for minification. Exclude if you want non-minified output
]
};