// vite.config.js
import { defineConfig } from "vite";
import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js";
import checker from "vite-plugin-checker";

const sourcemap = process.env.SOURCE_MAP === "true";

export default defineConfig({
  plugins: [
    checker({
      typescript: true,
    }),
    cssInjectedByJsPlugin(),
  ],
  build: {
    cssCodeSplit: false,
    rollupOptions: {
      input: "src/index.ts", // entry file
      output: {
        entryFileNames: "alc_runtime.js",
        // assetFileNames:'alc_kintone_style.css'
      },
    },
    sourcemap: sourcemap?sourcemap:false,
  },
});
