nak/build.js

24 lines
527 B
JavaScript
Raw Normal View History

2022-02-22 10:21:47 -05:00
#!/usr/bin/env node
2022-03-05 11:21:21 -05:00
const esbuild = require('esbuild')
const alias = require('esbuild-plugin-alias')
const nodeGlobals = require('@esbuild-plugins/node-globals-polyfill').default
esbuild
.build({
entryPoints: ['globals.js'],
outfile: 'globals.bundle.js',
bundle: true,
plugins: [
alias({
stream: require.resolve('readable-stream')
}),
nodeGlobals({buffer: true})
],
define: {
window: 'self',
global: 'self'
}
2022-02-22 10:21:47 -05:00
})
2022-03-05 11:21:21 -05:00
.then(() => console.log('build success.'))