easy-team / egg-view-vue-ssr

Egg Vue Server Side Render (SSR) Plugin
https://easyjs.cn/egg-vue
MIT License
95 stars 13 forks source link

feat: not throw error while resource not exist #5

Closed whxaxes closed 6 years ago

whxaxes commented 6 years ago

当 manifest.json 不存在的时候,调用 render 会抛错,在单测中的纯前端渲染的情况下,跑单测的时候会挂掉,除非提交 manifest.json 或者先构建再跑单测。

所以做了一下兼容,如果 resource 不存在则返回空

codecov[bot] commented 6 years ago

Codecov Report

Merging #5 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master       #5   +/-   ##
=======================================
  Coverage   94.38%   94.38%           
=======================================
  Files           6        6           
  Lines          89       89           
=======================================
  Hits           84       84           
  Misses          5        5
Impacted Files Coverage Δ
lib/engine.js 91.07% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 97c003e...8397cc1. Read the comment docs.