Only build sourcemap for !prod

This commit is contained in:
Adria Navarro 2024-11-28 10:31:44 +01:00
parent 18cd0169d8
commit a73165470e
1 changed files with 24 additions and 21 deletions

View File

@ -3,27 +3,30 @@ import { svelte } from "@sveltejs/vite-plugin-svelte"
import postcss from "postcss"
import path from "path"
export default defineConfig({
build: {
sourcemap: true,
lib: {
entry: "src/index.js",
formats: ["es"],
fileName: "bbui.es",
export default defineConfig(({ mode }) => {
const isProduction = mode === "production"
return {
build: {
sourcemap: !isProduction,
lib: {
entry: "src/index.js",
formats: ["es"],
fileName: "bbui.es",
},
},
},
plugins: [
svelte({
emitCss: true,
}),
],
css: {
postcss,
},
resolve: {
alias: {
"@budibase/shared-core": path.resolve(__dirname, "../shared-core/src"),
"@budibase/types": path.resolve(__dirname, "../types/src"),
plugins: [
svelte({
emitCss: true,
}),
],
css: {
postcss,
},
},
resolve: {
alias: {
"@budibase/shared-core": path.resolve(__dirname, "../shared-core/src"),
"@budibase/types": path.resolve(__dirname, "../types/src"),
},
},
}
})