mirror of
https://github.com/Microsoft/vscode
synced 2024-10-12 06:17:18 +00:00
added build stuff
This commit is contained in:
parent
0fa857c9a1
commit
3981a5804c
52
extensions/ipynb/esbuild.js
Normal file
52
extensions/ipynb/esbuild.js
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
//@ts-check
|
||||
|
||||
const path = require('path');
|
||||
const fse = require('fs-extra');
|
||||
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 srcDir = path.join(__dirname, 'src');
|
||||
const outDir = path.join(outputRoot, 'out');
|
||||
|
||||
async function build() {
|
||||
await esbuild.build({
|
||||
entryPoints: [
|
||||
path.join(srcDir, 'cellAttachmentRenderer.ts'),
|
||||
],
|
||||
bundle: true,
|
||||
minify: false,
|
||||
sourcemap: false,
|
||||
format: 'esm',
|
||||
outdir: outDir,
|
||||
platform: 'browser',
|
||||
target: ['es2020'],
|
||||
});
|
||||
|
||||
// fse.copySync(
|
||||
// path.join(__dirname, 'node_modules', 'katex', 'dist'),
|
||||
// path.join(outDir, 'katex.min.css'));
|
||||
|
||||
}
|
||||
|
||||
|
||||
build().catch(() => process.exit(1));
|
||||
|
||||
if (isWatch) {
|
||||
const watcher = require('@parcel/watcher');
|
||||
watcher.subscribe(srcDir, () => {
|
||||
return build();
|
||||
});
|
||||
}
|
|
@ -51,6 +51,16 @@
|
|||
"priority": "default"
|
||||
}
|
||||
],
|
||||
"notebookRenderer": [
|
||||
{
|
||||
"id": "vscode.markdown-it-cell-attachment-renderer-extension",
|
||||
"displayName": "Markdown it ipynb Cell Attachment renderer",
|
||||
"entrypoint": {
|
||||
"extends": "vscode.markdown-it-renderer",
|
||||
"path": "./out/cellAttachmentRenderer.js"
|
||||
}
|
||||
}
|
||||
],
|
||||
"menus": {
|
||||
"file/newFile": [
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue