2023-01-30 11:01:34 +02:00
|
|
|
import * as esbuild from 'esbuild'
|
|
|
|
import pluginVue from 'esbuild-plugin-vue-next'
|
|
|
|
import { sassPlugin } from 'esbuild-sass-plugin'
|
2022-07-29 13:23:08 +02:00
|
|
|
|
|
|
|
const doWatch = process.env.WATCH == 'true' ? true : false;
|
|
|
|
const doMinify = process.env.MINIFY == 'true' ? true : false;
|
|
|
|
|
2023-03-31 06:29:04 +02:00
|
|
|
const ctx = await esbuild.context(
|
|
|
|
{
|
|
|
|
entryPoints: [
|
|
|
|
"server/ui-src/app.js",
|
|
|
|
"server/ui-src/docs.js"
|
|
|
|
],
|
|
|
|
bundle: true,
|
|
|
|
minify: doMinify,
|
|
|
|
sourcemap: false,
|
2023-06-30 12:16:43 +02:00
|
|
|
define: {
|
|
|
|
'__VUE_OPTIONS_API__': 'true',
|
|
|
|
'__VUE_PROD_DEVTOOLS__': 'false',
|
2024-02-01 09:54:15 +02:00
|
|
|
'__VUE_PROD_HYDRATION_MISMATCH_DETAILS__': 'false',
|
2023-06-30 12:16:43 +02:00
|
|
|
},
|
2023-03-31 06:29:04 +02:00
|
|
|
outdir: "server/ui/dist/",
|
|
|
|
plugins: [pluginVue(), sassPlugin()],
|
|
|
|
loader: {
|
|
|
|
".svg": "file",
|
|
|
|
".woff": "file",
|
|
|
|
".woff2": "file",
|
|
|
|
},
|
|
|
|
logLevel: "info"
|
|
|
|
}
|
|
|
|
)
|
2023-01-30 11:01:34 +02:00
|
|
|
|
|
|
|
if (doWatch) {
|
|
|
|
await ctx.watch()
|
|
|
|
} else {
|
|
|
|
await ctx.rebuild()
|
|
|
|
ctx.dispose()
|
|
|
|
}
|