mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
fix(cli): add stub embedded assets generation to build process
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { dirname, join } from 'node:path';
|
||||
import { writeFileSync } from 'node:fs';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const scriptDir = dirname(fileURLToPath(import.meta.url));
|
||||
const cliRoot = join(scriptDir, '..');
|
||||
const workspaceRoot = join(cliRoot, '..');
|
||||
const outputPath = join(workspaceRoot, 'server', 'src', 'web', 'embeddedAssets.generated.ts');
|
||||
const contents = [
|
||||
'// This file is generated by cli/scripts/build-executable.ts when --with-web-assets is not used.',
|
||||
'// It intentionally contains no embedded assets.',
|
||||
'',
|
||||
'export interface EmbeddedWebAsset {',
|
||||
' path: string;',
|
||||
' sourcePath: string;',
|
||||
' mimeType: string;',
|
||||
'}',
|
||||
'',
|
||||
'export const embeddedAssets: EmbeddedWebAsset[] = [];',
|
||||
''
|
||||
].join('\n');
|
||||
|
||||
writeFileSync(outputPath, contents, 'utf-8');
|
||||
Reference in New Issue
Block a user