mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 07:05:11 +00:00
fix: use html.contents
This commit is contained in:
parent
00ccbdcfd8
commit
374487ea29
@ -22,7 +22,7 @@ export async function build (options: SLSOptions) {
|
|||||||
const htmlTemplate = { src: htmlSrc, contents: '', dst: '', compiled: '' }
|
const htmlTemplate = { src: htmlSrc, contents: '', dst: '', compiled: '' }
|
||||||
htmlTemplate.dst = htmlTemplate.src.replace(/.html$/, '.js').replace('app.', 'document.')
|
htmlTemplate.dst = htmlTemplate.src.replace(/.html$/, '.js').replace('app.', 'document.')
|
||||||
htmlTemplate.contents = await readFile(htmlTemplate.src, 'utf-8')
|
htmlTemplate.contents = await readFile(htmlTemplate.src, 'utf-8')
|
||||||
htmlTemplate.compiled = serializeTemplate(htmlTemplate.src)
|
htmlTemplate.compiled = serializeTemplate(htmlTemplate.contents)
|
||||||
await hooks.callHook('template:document', htmlTemplate)
|
await hooks.callHook('template:document', htmlTemplate)
|
||||||
await writeFileP(htmlTemplate.dst, htmlTemplate.compiled)
|
await writeFileP(htmlTemplate.dst, htmlTemplate.compiled)
|
||||||
consola.info('Generated', prettyPath(htmlTemplate.dst))
|
consola.info('Generated', prettyPath(htmlTemplate.dst))
|
||||||
|
Loading…
Reference in New Issue
Block a user