Browse Source

ssr: fix json bundle path (fix #5037)

dev
Evan You 8 years ago
parent
commit
367f781f44
  1. 3
      src/server/create-bundle-renderer.js

3
src/server/create-bundle-renderer.js

@ -43,9 +43,10 @@ export function createBundleRendererCreator (createRenderer: () => Renderer) {
path.isAbsolute(bundle)
) {
if (fs.existsSync(bundle)) {
const isJSON = /\.json$/.test(bundle)
basedir = basedir || path.dirname(bundle)
bundle = fs.readFileSync(bundle, 'utf-8')
if (/\.json$/.test(bundle)) {
if (isJSON) {
try {
bundle = JSON.parse(bundle)
} catch (e) {

Loading…
Cancel
Save