This repository has been archived on 2024-09-09 . You can view files and clone it, but cannot push or open issues or pull requests.
cc50e7f72b
33 lines
977 B
JavaScript
33 lines
977 B
JavaScript
/*---------------------------------------------------------------------------------------------
|
|||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|||
*--------------------------------------------------------------------------------------------*/
|
|||
const path = require('path');
|
|||
const esbuild = require('esbuild');
|
|||
|
|||
const args = process.argv.slice(2);
|
|||
|
|||
const isWatch = args.indexOf('--watch') >= 0;
|
|||
|
|||
let outputRoot = __dirname;
|
|||
const outputRootIndex = args.indexOf('--outputRoot');
|
|||
if (outputRootIndex >= 0) {
|
|||
outputRoot = args[outputRootIndex + 1];
|
|||
}
|
|||
|
|||
const outDir = path.join(outputRoot, 'notebook-out');
|
|||
|
|||
esbuild.build({
|
|||
entryPoints: [
|
|||
path.join(__dirname, 'notebook', 'index.ts'),
|
|||
],
|
|||
bundle: true,
|
|||
minify: true,
|
|||
sourcemap: false,
|
|||
format: 'esm',
|
|||
outdir: outDir,
|
|||
platform: 'browser',
|
|||
target: ['es2020'],
|
|||
incremental: isWatch,
|
|||
}).catch(() => process.exit(1));
|