forked from QwikDev/qwik
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
23 lines (17 loc) · 717 Bytes
/
index.js
File metadata and controls
23 lines (17 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/**
* This is the root build scripts module (keep in commonjs). It's only a .js file
* but will handling registering typescript files with esbuild-register
* to allow NodeJS to build .ts files on-demand.
*/
const { register } = require('esbuild-register/dist/node');
const esmNode = parseInt(process.version.slice(1).split('.')[0], 10) >= 14;
register({ target: esmNode ? 'node16' : 'node10' });
const { build } = require('./build.ts');
const { loadConfig } = require('./util.ts');
const args = process.argv.slice(2);
// load our build config, which figures out all the paths
// the rest of the build process uses.
const config = loadConfig(args);
config.esmNode = esmNode;
// let's do this!
build(config);