mirror of
https://github.com/fiatjaf/nak.git
synced 2025-12-13 02:28:50 +00:00
initial version with basic event utils.
This commit is contained in:
26
build.js
Executable file
26
build.js
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const esbuild = require('esbuild')
|
||||
const alias = require('esbuild-plugin-alias')
|
||||
const nodeGlobals = require('@esbuild-plugins/node-globals-polyfill').default
|
||||
|
||||
const prod = process.argv.indexOf('prod') !== -1
|
||||
|
||||
esbuild
|
||||
.build({
|
||||
bundle: true,
|
||||
entryPoints: ['app.jsx'],
|
||||
outdir: 'public',
|
||||
plugins: [
|
||||
alias({
|
||||
stream: require.resolve('readable-stream')
|
||||
}),
|
||||
nodeGlobals({buffer: true})
|
||||
],
|
||||
sourcemap: prod ? false : 'inline',
|
||||
define: {
|
||||
window: 'self',
|
||||
global: 'self'
|
||||
}
|
||||
})
|
||||
.then(() => console.log('build success.'))
|
||||
Reference in New Issue
Block a user