File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import { readFile, writeFile } from 'node:fs/promises';
1313import { mergeWit } from '../lib/wit_tools.js' ;
1414//@ts -ignore
1515import { precompile } from "./precompile.js"
16+ import path from 'node:path'
1617
1718async function main ( ) {
1819 try {
@@ -65,9 +66,16 @@ async function main() {
6566 const source = await readFile ( src , 'utf8' ) ;
6667 const precompiledSource = precompile ( source , src , true ) as string ;
6768
68- // Using the old syntax because the new syntax does not allow passing in the precompiled string
69- //@ts -ignore
70- const { component } = await componentize ( precompiledSource , inlineWit , {
69+ // Write precompiled source to disk for debugging purposes In the future we
70+ // will also write a source map to make debugging easier
71+ let srcDir = path . dirname ( src ) ;
72+ let precompiledSourcePath = path . join ( srcDir , 'precompiled-source.js' ) ;
73+ await writeFile ( precompiledSourcePath , precompiledSource ) ;
74+
75+ const { component } = await componentize ( {
76+ sourcePath : precompiledSourcePath ,
77+ // @ts -ignore
78+ witWorld : inlineWit ,
7179 runtimeArgs,
7280 enableAot : CliArgs . aot ,
7381 } ) ;
You can’t perform that action at this time.
0 commit comments