Skip to content

Commit

Permalink
[webpack] update SPA template inject
Browse files Browse the repository at this point in the history
  • Loading branch information
Diablohu committed Mar 29, 2019
1 parent 77bd183 commit 5442a14
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/koot-webpack/plugins/spa-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,19 @@ class SpaTemplatePlugin {
})()
// console.log(Object.assign({}, defaultInject, inject))

const projectInject = ((thisModule) => {
if (typeof thisModule.default === 'object')
return thisModule.default
if (typeof thisModule === 'object')
return thisModule
return {}
})(eval(fs.readFileSync(inject, 'utf-8')))

const html = renderTemplate({
template,
inject: {
...defaultInject,
...eval(fs.readFileSync(inject, 'utf-8')).default
...projectInject
},
compilation
})
Expand Down
5 changes: 5 additions & 0 deletions packages/koot/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.8.4
**2019-03-29**
- React SPA
- 进一步优化模板注入

## 0.8.3
**2019-03-29**
- 错误修正
Expand Down

0 comments on commit 5442a14

Please sign in to comment.