Skip to content

Commit

Permalink
component autostart in test.html
Browse files Browse the repository at this point in the history
jin committed Jan 27, 2025
1 parent 2f6074f commit 1a12c33
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build/build.node.ts
Original file line number Diff line number Diff line change
@@ -1008,10 +1008,11 @@ namespace $ {
const pack = $mol_file.absolute( path )
const source = pack.resolve( 'index.html' )
const target = pack.resolve( `-/test.html` )
const name = '$' + pack.relate( this.root() ).replaceAll( '/', '_' )

let content = source.exists()
? source.text()
: `<!doctype html><meta charset="utf-8" /><body><script src="web.js" charset="utf-8"></script>`
: `<!doctype html><meta charset="utf-8" /><body mol_view_root="${name}"><script src="web.js" charset="utf-8"></script>`

content = content.replace(
/(<\/body>|$)/ , `

0 comments on commit 1a12c33

Please sign in to comment.