Skip to content

Commit

Permalink
fix: 修复 clientManifestAddDll 如果找不到正确的path 需要扔出错误原因
Browse files Browse the repository at this point in the history
  • Loading branch information
孙颢 committed Dec 15, 2018
1 parent 9446145 commit 6936f23
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"version": "standard-version -r patch",
"test:init": "mkdir ~/Documents/imsunhao/sh-blog/node_modules/@bestminr && ln -s ~/Documents/imsunhao/lib/build ~/Documents/imsunhao/sh-blog/node_modules/@bestminr/build",
"test:reTest": "rm -rf ~/Documents/imsunhao/sh-blog/node_modules/@bestminr/build && ln -s ~/Documents/imsunhao/lib/build ~/Documents/imsunhao/sh-blog/node_modules/@bestminr/build",
"test:reTest:blueberry": "rm -rf /Users/sunhao/Documents/blueberry/node_modules/@bestminr/build && ln -s ~/Documents/imsunhao/lib/build /Users/sunhao/Documents/blueberry/node_modules/@bestminr/build"
"test:reTest:blueberry": "rm -rf /Users/sunhao/Documents/blueberry/node_modules/@bestminr/build && ln -s ~/Documents/imsunhao/lib/build /Users/sunhao/Documents/blueberry/node_modules/@bestminr/build",
"debug:stage": "rsync ./dist/start.js git@bm9:/home/git/workspace/deploys/duomu_deploy/blueberry/node_modules/@bestminr/build/dist/start.js"
},
"files": [
"bin/*",
Expand Down
27 changes: 16 additions & 11 deletions src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,18 +134,23 @@ function clientManifestAddDll(clientManifest: any) {
const config = getConfig()
if (config.webpack && config.webpack.client && config.webpack.client.output)
if (config.webpack.dll) {
const dllManifest = JSON.parse(
readFileSync(
path.resolve(config.webpack.dll.path, './vue-ssr-dll-manifest.json'),
'utf-8'
try {
const dllManifest = JSON.parse(
readFileSync(
path.resolve(config.webpack.dll.path, './vue-ssr-dll-manifest.json'),
'utf-8'
)
)
)
dllManifest.all.forEach((js: string) => {
clientManifest.all.push('dll/' + js)
})
dllManifest.initial.forEach((js: string) => {
clientManifest.initial.unshift('dll/' + js)
})
dllManifest.all.forEach((js: string) => {
clientManifest.all.push('dll/' + js)
})
dllManifest.initial.forEach((js: string) => {
clientManifest.initial.unshift('dll/' + js)
})
} catch (error) {
consola.fatal('clientManifestAddDll', error)
return process.exit(0)
}
}
return clientManifest
}
Expand Down

0 comments on commit 6936f23

Please sign in to comment.