2023-03-15 06:42:14 +03:00
|
|
|
/** @file Script that bundles JS client code. */
|
2022-08-10 04:41:44 +03:00
|
|
|
|
2023-03-15 06:42:14 +03:00
|
|
|
import * as path from 'node:path'
|
|
|
|
import * as url from 'node:url'
|
|
|
|
|
|
|
|
import * as esbuild from 'esbuild'
|
|
|
|
|
2023-03-31 17:19:07 +03:00
|
|
|
import * as bundler from './esbuild-config'
|
|
|
|
import * as dashboardBundler from '../dashboard/esbuild-config'
|
2023-03-15 06:42:14 +03:00
|
|
|
|
|
|
|
// =================
|
|
|
|
// === Constants ===
|
|
|
|
// =================
|
|
|
|
|
|
|
|
export const THIS_PATH = path.resolve(path.dirname(url.fileURLToPath(import.meta.url)))
|
2023-02-19 03:37:58 +03:00
|
|
|
|
2022-08-10 04:41:44 +03:00
|
|
|
// ================
|
|
|
|
// === Bundling ===
|
|
|
|
// ================
|
|
|
|
|
2023-03-31 17:19:07 +03:00
|
|
|
// The dashboard bundler bundles `tailwind.css`.
|
|
|
|
const DASHBOARD_BUNDLER_OPTIONS = dashboardBundler.bundleOptions()
|
|
|
|
await esbuild.build(DASHBOARD_BUNDLER_OPTIONS)
|
|
|
|
const BUNDLER_OPTIONS = bundler.bundlerOptionsFromEnv()
|
2023-03-15 06:42:14 +03:00
|
|
|
await esbuild.build(BUNDLER_OPTIONS)
|