2023-02-21 13:36:06 +01:00
|
|
|
const config = require("./esbuild.config.js")
|
|
|
|
const svelteConfig = require("./svelte.config")
|
|
|
|
|
|
|
|
config.options.sourcemap = "inline"
|
|
|
|
config.options.minify = false
|
|
|
|
config.options.platform = "node"
|
|
|
|
config.options.format = "cjs"
|
2024-04-10 10:26:40 +02:00
|
|
|
// es2015 will transform async/await to generators, but not working with svelte
|
|
|
|
// so we need babel to transform async/await to promises
|
|
|
|
// config.options.target = "es2015"
|
2023-02-21 13:36:06 +01:00
|
|
|
config.options.entryPoints = ["./frontend/src/ssr.ts"]
|
|
|
|
config.options.outfile = __dirname + "/_temp/app.server.js"
|
|
|
|
config.options.plugins = [
|
|
|
|
config.sveltePlugin({
|
|
|
|
compilerOptions: {
|
|
|
|
generate: "ssr",
|
2024-01-27 19:58:35 +01:00
|
|
|
css: false,
|
2023-02-21 13:36:06 +01:00
|
|
|
hydratable: true,
|
|
|
|
dev: (process.argv?.length > 2 ? process.argv[2] : "build") !== "build",
|
|
|
|
},
|
|
|
|
preprocess: svelteConfig.preprocess,
|
2024-04-10 10:26:40 +02:00
|
|
|
filterWarnings: (warning) => {
|
|
|
|
// filter out a11y
|
|
|
|
if (warning.code.match(/^a11y/)) return false
|
|
|
|
return true
|
|
|
|
},
|
2023-02-21 13:36:06 +01:00
|
|
|
}),
|
|
|
|
config.resolvePlugin,
|
|
|
|
]
|
|
|
|
|
|
|
|
module.exports = config
|