mirror of
https://github.com/hanzoai/insights.git
synced 2026-10-30 16:15:31 +00:00
frontend/utils.mjs went upstream into @hanzo/esbuilder (#28441). The convergence took that deletion but two importers stayed behind, so a FRESH CLONE died at @hanzo/elements#build with ERR_MODULE_NOT_FOUND — which is why no insights image has published since the merge landed. Both now import the package, and elements declares the dependency it uses rather than reaching up the tree for it. The Python import gate could not see this: it reads .py only.
37 lines
1.0 KiB
JavaScript
Executable File
37 lines
1.0 KiB
JavaScript
Executable File
#!/usr/bin/env node
|
|
import * as fs from 'fs'
|
|
import * as path from 'path'
|
|
import url from 'url'
|
|
|
|
import { buildInParallel, printResponse, startDevServer } from '@hanzo/esbuilder'
|
|
|
|
export const __dirname = path.dirname(url.fileURLToPath(import.meta.url))
|
|
const { name, peerDependencies } = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json')))
|
|
|
|
startDevServer(__dirname)
|
|
|
|
await buildInParallel(
|
|
[
|
|
{
|
|
name,
|
|
absWorkingDir: __dirname,
|
|
entryPoints: ['./src/index.ts'],
|
|
format: 'cjs',
|
|
outfile: 'dist/index.js',
|
|
bundle: true,
|
|
chunkNames: '[name]',
|
|
entryNames: '[dir]/[name]',
|
|
external: Object.keys(peerDependencies ?? []),
|
|
publicPath: '',
|
|
minify: true,
|
|
target: 'esnext',
|
|
sourcemap: false,
|
|
},
|
|
],
|
|
{
|
|
async onBuildComplete(config, response) {
|
|
await printResponse(response, { verbose: true, compact: false })
|
|
},
|
|
}
|
|
)
|