budibase/packages/bbui/vite.config.js

30 lines
714 B
JavaScript
Raw Normal View History

2024-11-27 10:59:34 +01:00
import { defineConfig } from "vite"
import { svelte } from "@sveltejs/vite-plugin-svelte"
2024-11-27 11:12:39 +01:00
import path from "path"
2024-11-29 09:40:16 +01:00
import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js"
2024-11-27 10:59:34 +01:00
2024-11-28 10:31:44 +01:00
export default defineConfig(({ mode }) => {
const isProduction = mode === "production"
return {
build: {
sourcemap: !isProduction,
lib: {
entry: "src/index.js",
formats: ["es"],
},
2024-11-27 10:59:34 +01:00
},
2024-11-28 10:31:44 +01:00
plugins: [
svelte({
emitCss: true,
}),
2024-11-29 09:40:16 +01:00
cssInjectedByJsPlugin(),
2024-11-28 10:31:44 +01:00
],
resolve: {
alias: {
"@budibase/shared-core": path.resolve(__dirname, "../shared-core/src"),
"@budibase/types": path.resolve(__dirname, "../types/src"),
},
},
}
2024-11-27 10:59:34 +01:00
})