templatesFiles ~> templates

This commit is contained in:
Pooya Parsa 2017-05-11 23:17:53 +04:30
parent 4800a9e8fd
commit 336ebd4959
2 changed files with 4 additions and 5 deletions

View File

@ -58,7 +58,7 @@ const defaults = {
plugins: [], plugins: [],
babel: {}, babel: {},
postcss: [], postcss: [],
templatesFiles: [] templates: []
} }
const defaultsLoaders = [ const defaultsLoaders = [
{ {
@ -245,10 +245,9 @@ function * generateRoutesAndFiles () {
// Resolve all internal template files relative to app directory // Resolve all internal template files relative to app directory
templatesFiles = templatesFiles.map(file => { return {src: r(__dirname, 'app', file), dst: file} }) templatesFiles = templatesFiles.map(file => { return {src: r(__dirname, 'app', file), dst: file} })
// Add external template files (used in modules) // Add external template files (used in modules)
if (Array.isArray(this.options.build.templatesFiles)) { if (Array.isArray(this.options.build.templates)) {
templatesFiles = templatesFiles.concat(this.options.build.templatesFiles) templatesFiles = templatesFiles.concat(this.options.build.templates)
} }
let moveTemplates = templatesFiles.map(({src, dst, options}) => { let moveTemplates = templatesFiles.map(({src, dst, options}) => {
return readFile(src, 'utf8') return readFile(src, 'utf8')
.then((fileContent) => { .then((fileContent) => {

View File

@ -40,7 +40,7 @@ class Module {
dst, dst,
options: template.options options: template.options
} }
this.options.build.templatesFiles.push(templateObj) this.options.build.templates.push(templateObj)
return templateObj return templateObj
} }