mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +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/
|
||||
await Promise.all(
|
||||
templateFiles.map(async ({ src, dst, options, custom }) => {
|
||||
templateFiles.map(async (templateFile) => {
|
||||
const { src, dst, custom } = templateFile
|
||||
|
||||
// Add custom templates to watcher
|
||||
if (custom) {
|
||||
this.options.build.watch.push(src)
|
||||
@ -510,14 +512,14 @@ export default class Builder {
|
||||
try {
|
||||
const templateFunction = template(fileContent, templateOptions)
|
||||
content = stripWhitespace(
|
||||
templateFunction(
|
||||
Object.assign({}, templateVars, {
|
||||
options: options || {},
|
||||
custom,
|
||||
src,
|
||||
dst
|
||||
})
|
||||
)
|
||||
templateFunction({
|
||||
...templateVars,
|
||||
...templateFile,
|
||||
options: {
|
||||
...templateVars.options,
|
||||
...templateFile.options
|
||||
}
|
||||
})
|
||||
)
|
||||
} catch (err) {
|
||||
throw new Error(`Could not compile template ${src}: ${err.message}`)
|
||||
|
Loading…
Reference in New Issue
Block a user