forked from LibertyDSNP/parquetjs
-
Notifications
You must be signed in to change notification settings - Fork 2
/
esbuild-serve.js
23 lines (23 loc) · 892 Bytes
/
esbuild-serve.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/**
* Use this to serve the parquetjs bundle at http://localhost:8000/main.js
* It attaches the parquet.js exports to a "parquetjs" global variable.
* See the example server for how to use it.
*/
const {compressionBrowserPlugin, wasmPlugin} = require("./esbuild-plugins");
// esbuild has TypeScript support by default. It will use .tsconfig
require('esbuild')
.serve({
servedir: __dirname,
}, {
entryPoints: ['parquet.ts'],
outfile: 'main.js',
define: {"process.env.NODE_DEBUG": false, "process.env.NODE_ENV": "\"production\"", global: "window" },
platform: 'browser',
plugins: [compressionBrowserPlugin,wasmPlugin],
sourcemap: "external",
bundle: true,
globalName: 'parquetjs',
inject: ['./esbuild-shims.js']
}).then(server => {
console.log("serving parquetjs", server)
})