resistants/vite.config.ts

27 lines
788 B
TypeScript
Raw Normal View History

2023-02-25 21:02:50 +00:00
import react from "@vitejs/plugin-react-swc";
import { defineConfig } from "vite";
import { imagetools } from "vite-imagetools";
2023-01-29 20:27:02 +00:00
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), imagetools()],
base: "resistants",
2023-01-29 20:27:02 +00:00
build: {
rollupOptions: {
output: {
// this name is used in the code to inject module in squarespace
entryFileNames: "resistants.js",
assetFileNames: (meta) => {
const name = meta.name;
if (name !== "squarespace-site.css" && name.indexOf(".css") > 0) {
// this name is used in the code to inject module in squarespace
return "resistants.css";
}
return "assets/[name]-[hash].[ext]";
},
2023-02-25 21:02:50 +00:00
},
},
2023-02-25 21:02:50 +00:00
outDir: "public",
},
});