-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrollup.config.js
43 lines (32 loc) · 976 Bytes
/
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
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import copy from 'rollup-plugin-copy';
import json from '@rollup/plugin-json'
import { terser } from 'rollup-plugin-terser';
export default {
/* Specify main file for EdgeWorker */
input: 'src/main.js',
/* Define external modules, which will be provided by the EdgeWorker platform */
external: ['log', 'http-request', 'cookies'],
/* Define output format as an ES module and specify the output directory */
output: {
format: 'es',
dir: "dist"
},
/* Bundle all modules into a single output module */
preserveModules: false,
plugins: [
/* Convert CommonJS modules to ES6 */
commonjs(),
json(),
/* Resolve modules from node_modules */
resolve({browser: true}),
/* Copy bundle.json to the output directory */
copy({
targets: [
{ src: 'bundle.json', dest: 'dist' }
]
}),
terser(),
]
};