-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbundle.js
More file actions
27 lines (24 loc) · 767 Bytes
/
bundle.js
File metadata and controls
27 lines (24 loc) · 767 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
const esbuild = require('esbuild')
const plugin = require('node-stdlib-browser/helpers/esbuild/plugin');
const stdLibBrowser = require('node-stdlib-browser');
// Automatically exclude all node_modules from the bundled version
// const { nodeExternalsPlugin } = require('esbuild-node-externals')
esbuild.build({
entryPoints: ['./src/index.ts'],
outfile: 'dist/bundle.js',
bundle: true,
minify: true,
platform: 'browser', //node
sourcemap: true,
target: 'node16',
// external: ["fs"],
inject: [require.resolve('node-stdlib-browser/helpers/esbuild/shim')],
define: {
global: 'global',
process: 'process',
Buffer: 'Buffer'
},
plugins: [plugin(stdLibBrowser)],
format: 'iife',
globalName: 'Vert'
}).catch(() => process.exit(1))