chore: bootstrap mv3 extension project
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import { cp, mkdir, rm } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { build } from "tsup";
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const projectRoot = path.resolve(__dirname, "..");
|
||||
const distDir = path.join(projectRoot, "dist");
|
||||
|
||||
await rm(distDir, { recursive: true, force: true });
|
||||
await mkdir(path.join(distDir, "content"), { recursive: true });
|
||||
|
||||
await build({
|
||||
entry: {
|
||||
index: path.join(projectRoot, "src/content/index.ts")
|
||||
},
|
||||
format: ["iife"],
|
||||
globalName: "StarChartSearchEnhancer",
|
||||
platform: "browser",
|
||||
target: "chrome114",
|
||||
outDir: path.join(distDir, "content"),
|
||||
clean: false,
|
||||
splitting: false,
|
||||
sourcemap: false,
|
||||
minify: false,
|
||||
outExtension() {
|
||||
return { js: ".js" };
|
||||
}
|
||||
});
|
||||
|
||||
await cp(
|
||||
path.join(projectRoot, "src/manifest.json"),
|
||||
path.join(distDir, "manifest.json")
|
||||
);
|
||||
Reference in New Issue
Block a user