budibase/packages/builder/vite.config.js

60 lines
1.5 KiB
JavaScript
Raw Normal View History

import svelte from "@sveltejs/vite-plugin-svelte"
import replace from "@rollup/plugin-replace"
import path from "path"
export default ({ mode }) => {
const isProduction = mode === "production"
return {
base: "/builder/",
build: {
minify: isProduction,
outDir: "../server/builder",
},
plugins: [
2021-03-31 20:12:28 +02:00
svelte({
hot: !isProduction,
emitCss: true,
}),
replace({
preventAssignment: true,
"process.env.NODE_ENV": JSON.stringify(
isProduction ? "production" : "development"
),
"process.env.POSTHOG_TOKEN": JSON.stringify(process.env.POSTHOG_TOKEN),
"process.env.POSTHOG_URL": JSON.stringify(process.env.POSTHOG_URL),
"process.env.SENTRY_DSN": JSON.stringify(process.env.SENTRY_DSN),
}),
],
optimizeDeps: {
2021-04-06 16:48:01 +02:00
include: ['ag-grid-community'],
exclude: ["@roxi/routify"],
},
resolve: {
dedupe: ["@roxi/routify"],
alias: [
{
find: "components",
replacement: path.resolve("./src/components"),
},
{
find: "builderStore",
replacement: path.resolve("./src/builderStore"),
},
2021-04-01 11:29:47 +02:00
{
find: "stores",
replacement: path.resolve("./src/stores"),
},
{
find: "constants",
replacement: path.resolve("./src/constants"),
},
{
find: "analytics",
replacement: path.resolve("./src/analytics"),
},
],
},
}
}