nak/build.js
2022-03-05 13:21:21 -03:00

24 lines
527 B
JavaScript
Executable File

#!/usr/bin/env node
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'
}
})
.then(() => console.log('build success.'))