mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-12 03:38:07 +00:00
This commit is contained in:
parent
77a0e80e09
commit
b49dc0fe99
@ -498,7 +498,9 @@ export default class Builder {
|
|||||||
|
|
||||||
// Interpret and move template files to .nuxt/
|
// Interpret and move template files to .nuxt/
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
templateFiles.map(async ({ src, dst, options, custom }) => {
|
templateFiles.map(async (templateFile) => {
|
||||||
|
const { src, dst, custom } = templateFile
|
||||||
|
|
||||||
// Add custom templates to watcher
|
// Add custom templates to watcher
|
||||||
if (custom) {
|
if (custom) {
|
||||||
this.options.build.watch.push(src)
|
this.options.build.watch.push(src)
|
||||||
@ -510,15 +512,15 @@ export default class Builder {
|
|||||||
try {
|
try {
|
||||||
const templateFunction = template(fileContent, templateOptions)
|
const templateFunction = template(fileContent, templateOptions)
|
||||||
content = stripWhitespace(
|
content = stripWhitespace(
|
||||||
templateFunction(
|
templateFunction({
|
||||||
Object.assign({}, templateVars, {
|
...templateVars,
|
||||||
options: options || {},
|
...templateFile,
|
||||||
custom,
|
options: {
|
||||||
src,
|
...templateVars.options,
|
||||||
dst
|
...templateFile.options
|
||||||
|
}
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
)
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw new Error(`Could not compile template ${src}: ${err.message}`)
|
throw new Error(`Could not compile template ${src}: ${err.message}`)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user