tibi-docs/esbuild.config.server.js
Sebastian Frank 1ebd1424e5
Some checks failed
deploy to production / deploy (push) Failing after 52s
ssr via fetch
2024-04-10 08:26:40 +00:00

32 lines
1.0 KiB
JavaScript

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"
// 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"
config.options.entryPoints = ["./frontend/src/ssr.ts"]
config.options.outfile = __dirname + "/_temp/app.server.js"
config.options.plugins = [
config.sveltePlugin({
compilerOptions: {
generate: "ssr",
css: false,
hydratable: true,
dev: (process.argv?.length > 2 ? process.argv[2] : "build") !== "build",
},
preprocess: svelteConfig.preprocess,
filterWarnings: (warning) => {
// filter out a11y
if (warning.code.match(/^a11y/)) return false
return true
},
}),
config.resolvePlugin,
]
module.exports = config