35 lines
1000 B
TypeScript
35 lines
1000 B
TypeScript
// vite.config.popup.ts
|
|
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react-swc";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
import path, { resolve } from "path";
|
|
import pkg from "./package.json";
|
|
import mnf from "./public/manifest.json";
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react(), tailwindcss()],
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
build: {
|
|
outDir: `${pkg.name}_${mnf.version}`,
|
|
rollupOptions: {
|
|
input: {
|
|
popup: resolve(__dirname, "index.html"),
|
|
content: resolve(__dirname, "src/content/content.ts"),
|
|
background: resolve(__dirname, "src/background/background.ts"),
|
|
},
|
|
output: {
|
|
entryFileNames: (chunk) => {
|
|
if (chunk.name === "content") return "content/content.js";
|
|
if (chunk.name === "background") return "background/background.js";
|
|
return "assets/[name].js";
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|