Skip to content
This repository has been archived by the owner on Jan 28, 2023. It is now read-only.

Commit

Permalink
Backport SSR bugfix when manifest files are missing:
Browse files Browse the repository at this point in the history
vuejs#11609

Also change build.dev.js to avoid the build process of Vue.js
  • Loading branch information
christoph-bessei committed Nov 3, 2020
1 parent bb253db commit 5d99f34
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 7 additions & 3 deletions packages/vue-server-renderer/build.dev.js
Expand Up @@ -8848,8 +8848,12 @@ function mapIdToFile (id, clientManifest) {
fileIndices.forEach(function (index) {
var file = clientManifest.all[index];
// only include async files or non-js, non-css assets
if (clientManifest.async.indexOf(file) > -1 || !(/\.(js|css)($|\?)/.test(file))) {
files.push(file);
if (
file &&
(clientManifest.async.indexOf(file) > -1 ||
!/\.(js|css)($|\?)/.test(file))
) {
files.push(file)
}
});
}
Expand All @@ -8874,7 +8878,7 @@ var TemplateRenderer = function TemplateRenderer (options) {
this.inject = options.inject !== false;
// if no template option is provided, the renderer is created
// as a utility object for rendering assets like preload links and scripts.

var template = options.template;
this.parsedTemplate = template
? typeof template === 'string'
Expand Down
6 changes: 5 additions & 1 deletion src/server/template-renderer/create-async-file-mapper.js
Expand Up @@ -44,7 +44,11 @@ function mapIdToFile (id, clientManifest) {
fileIndices.forEach(index => {
const file = clientManifest.all[index]
// only include async files or non-js, non-css assets
if (clientManifest.async.indexOf(file) > -1 || !(/\.(js|css)($|\?)/.test(file))) {
if (
file &&
(clientManifest.async.indexOf(file) > -1 ||
!/\.(js|css)($|\?)/.test(file))
) {
files.push(file)
}
})
Expand Down

0 comments on commit 5d99f34

Please sign in to comment.