added build stuff

This commit is contained in:
Michael Lively 2022-07-19 12:40:24 -07:00
parent 0fa857c9a1
commit 3981a5804c
2 changed files with 62 additions and 0 deletions

View 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();
});
}

View file

@ -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": [
{