mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-08-04 18:28:02 +00:00

* 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
29 lines
706 B
JavaScript
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));
|