tinymist/contrib/html/editors/vscode/esbuild.web.mjs
Myriad-Dreamin 548f64aec9
feat: initialize tinymist-vscode-html extension (#1378)
* feat: migrate eslint

* feat: workspace prettierrc

* feat: workspace eslint

* chore: format files

* build: update yarn.lock

* feat: init html extension

* feat: html extension first working flow

* feat: css class support

* feat: update package metadata

* feat: check string context

* feat: clean code

* feat: delete unused yarn.lock
2025-02-23 18:56:47 +08:00

29 lines
706 B
JavaScript

import { build } from "esbuild";
import { polyfillNode } from "esbuild-plugin-polyfill-node";
import * as fs from "fs";
if (!fs.existsSync("./out/extension.js")) {
fs.mkdirSync("./out", { recursive: true });
fs.writeFileSync("./out/extension.js", "");
}
build({
entryPoints: ["./src/extension.web.ts"],
bundle: true,
outfile: "./out/extension.web.js",
external: ["vscode"],
format: "cjs",
target: ["es2020", "chrome61", "edge18", "firefox60"],
// Node.js global to browser globalThis
define: {
global: "globalThis",
},
plugins: [
polyfillNode({
polyfills: {
crypto: "empty",
},
// Options (optional)
}),
],
}).catch(() => process.exit(1));