Skip to content

Commit

Permalink
build: build 2.6.14
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Jun 7, 2021
1 parent c52427b commit 8f6c4c3
Show file tree
Hide file tree
Showing 19 changed files with 119 additions and 53 deletions.
6 changes: 3 additions & 3 deletions dist/vue.common.dev.js
@@ -1,5 +1,5 @@
/*!
* Vue.js v2.6.13
* Vue.js v2.6.14
* (c) 2014-2021 Evan You
* Released under the MIT License.
*/
Expand Down Expand Up @@ -2612,7 +2612,7 @@ function normalizeScopedSlot(normalSlots, key, fn) {
var vnode = res && res[0];
return res && (
!vnode ||
(vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
(res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
) ? undefined
: res
};
Expand Down Expand Up @@ -5483,7 +5483,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
value: FunctionalRenderContext
});

Vue.version = '2.6.13';
Vue.version = '2.6.14';

/* */

Expand Down
4 changes: 2 additions & 2 deletions dist/vue.common.prod.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/vue.esm.browser.js
@@ -1,5 +1,5 @@
/*!
* Vue.js v2.6.13
* Vue.js v2.6.14
* (c) 2014-2021 Evan You
* Released under the MIT License.
*/
Expand Down Expand Up @@ -2640,7 +2640,7 @@ function normalizeScopedSlot(normalSlots, key, fn) {
let vnode = res && res[0];
return res && (
!vnode ||
(vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
(res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
) ? undefined
: res
};
Expand Down Expand Up @@ -5508,7 +5508,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
value: FunctionalRenderContext
});

Vue.version = '2.6.13';
Vue.version = '2.6.14';

/* */

Expand Down
4 changes: 2 additions & 2 deletions dist/vue.esm.browser.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/vue.esm.js
@@ -1,5 +1,5 @@
/*!
* Vue.js v2.6.13
* Vue.js v2.6.14
* (c) 2014-2021 Evan You
* Released under the MIT License.
*/
Expand Down Expand Up @@ -2618,7 +2618,7 @@ function normalizeScopedSlot(normalSlots, key, fn) {
var vnode = res && res[0];
return res && (
!vnode ||
(vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
(res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
) ? undefined
: res
};
Expand Down Expand Up @@ -5503,7 +5503,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
value: FunctionalRenderContext
});

Vue.version = '2.6.13';
Vue.version = '2.6.14';

/* */

Expand Down
6 changes: 3 additions & 3 deletions dist/vue.js
@@ -1,5 +1,5 @@
/*!
* Vue.js v2.6.13
* Vue.js v2.6.14
* (c) 2014-2021 Evan You
* Released under the MIT License.
*/
Expand Down Expand Up @@ -2616,7 +2616,7 @@
var vnode = res && res[0];
return res && (
!vnode ||
(vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
(res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
) ? undefined
: res
};
Expand Down Expand Up @@ -5487,7 +5487,7 @@
value: FunctionalRenderContext
});

Vue.version = '2.6.13';
Vue.version = '2.6.14';

/* */

Expand Down
4 changes: 2 additions & 2 deletions dist/vue.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/vue.runtime.common.dev.js
@@ -1,5 +1,5 @@
/*!
* Vue.js v2.6.13
* Vue.js v2.6.14
* (c) 2014-2021 Evan You
* Released under the MIT License.
*/
Expand Down Expand Up @@ -2603,7 +2603,7 @@ function normalizeScopedSlot(normalSlots, key, fn) {
var vnode = res && res[0];
return res && (
!vnode ||
(vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
(res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
) ? undefined
: res
};
Expand Down Expand Up @@ -5474,7 +5474,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
value: FunctionalRenderContext
});

Vue.version = '2.6.13';
Vue.version = '2.6.14';

/* */

Expand Down
4 changes: 2 additions & 2 deletions dist/vue.runtime.common.prod.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/vue.runtime.esm.js
@@ -1,5 +1,5 @@
/*!
* Vue.js v2.6.13
* Vue.js v2.6.14
* (c) 2014-2021 Evan You
* Released under the MIT License.
*/
Expand Down Expand Up @@ -2609,7 +2609,7 @@ function normalizeScopedSlot(normalSlots, key, fn) {
var vnode = res && res[0];
return res && (
!vnode ||
(vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
(res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
) ? undefined
: res
};
Expand Down Expand Up @@ -5494,7 +5494,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
value: FunctionalRenderContext
});

Vue.version = '2.6.13';
Vue.version = '2.6.14';

/* */

Expand Down
6 changes: 3 additions & 3 deletions dist/vue.runtime.js
@@ -1,5 +1,5 @@
/*!
* Vue.js v2.6.13
* Vue.js v2.6.14
* (c) 2014-2021 Evan You
* Released under the MIT License.
*/
Expand Down Expand Up @@ -2607,7 +2607,7 @@
var vnode = res && res[0];
return res && (
!vnode ||
(vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
(res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
) ? undefined
: res
};
Expand Down Expand Up @@ -5478,7 +5478,7 @@
value: FunctionalRenderContext
});

Vue.version = '2.6.13';
Vue.version = '2.6.14';

/* */

Expand Down
4 changes: 2 additions & 2 deletions dist/vue.runtime.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/vue-server-renderer/basic.js
Expand Up @@ -7666,7 +7666,7 @@
var vnode = res && res[0];
return res && (
!vnode ||
(vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
(res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
) ? undefined
: res
};
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-server-renderer/build.dev.js
Expand Up @@ -7416,7 +7416,7 @@ function normalizeScopedSlot(normalSlots, key, fn) {
var vnode = res && res[0];
return res && (
!vnode ||
(vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
(res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
) ? undefined
: res
};
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-server-renderer/build.prod.js

Large diffs are not rendered by default.

43 changes: 38 additions & 5 deletions packages/vue-server-renderer/client-plugin.js
Expand Up @@ -9,13 +9,28 @@ var isCSS = function (file) { return /\.css(\?[^.]+)?$/.test(file); };
var ref = require('chalk');
var red = ref.red;
var yellow = ref.yellow;
var webpack = require('webpack');

var prefix = "[vue-server-renderer-webpack-plugin]";
var warn = exports.warn = function (msg) { return console.error(red((prefix + " " + msg + "\n"))); };
var tip = exports.tip = function (msg) { return console.log(yellow((prefix + " " + msg + "\n"))); };

var onEmit = function (compiler, name, hook) {
if (compiler.hooks) {
var isWebpack5 = !!(webpack.version && webpack.version[0] > 4);

var onEmit = function (compiler, name, stageName, hook) {
if (isWebpack5) {
// Webpack >= 5.0.0
compiler.hooks.compilation.tap(name, function (compilation) {
if (compilation.compiler !== compiler) {
// Ignore child compilers
return
}
var stage = webpack.Compilation[stageName];
compilation.hooks.processAssets.tapAsync({ name: name, stage: stage }, function (assets, cb) {
hook(compilation, cb);
});
});
} else if (compiler.hooks) {
// Webpack >= 4.0.0
compiler.hooks.emit.tapAsync(name, hook);
} else {
Expand All @@ -24,6 +39,22 @@ var onEmit = function (compiler, name, hook) {
}
};

var stripModuleIdHash = function (id) {
if (isWebpack5) {
// Webpack >= 5.0.0
return id.replace(/\|\w+$/, '')
}
// Webpack < 5.0.0
return id.replace(/\s\w+$/, '')
};

var getAssetName = function (asset) {
if (typeof asset === 'string') {
return asset
}
return asset.name
};

var hash = require('hash-sum');
var uniq = require('lodash.uniq');

Expand All @@ -38,7 +69,8 @@ var VueSSRClientPlugin = function VueSSRClientPlugin (options) {
VueSSRClientPlugin.prototype.apply = function apply (compiler) {
var this$1 = this;

onEmit(compiler, 'vue-client-plugin', function (compilation, cb) {
var stage = 'PROCESS_ASSETS_STAGE_ADDITIONAL';
onEmit(compiler, 'vue-client-plugin', stage, function (compilation, cb) {
var stats = compilation.getStats().toJson();

var allFiles = uniq(stats.assets
Expand All @@ -47,6 +79,7 @@ VueSSRClientPlugin.prototype.apply = function apply (compiler) {
var initialFiles = uniq(Object.keys(stats.entrypoints)
.map(function (name) { return stats.entrypoints[name].assets; })
.reduce(function (assets, all) { return all.concat(assets); }, [])
.map(getAssetName)
.filter(function (file) { return isJS(file) || isCSS(file); }));

var asyncFiles = allFiles
Expand All @@ -62,7 +95,7 @@ VueSSRClientPlugin.prototype.apply = function apply (compiler) {
};

var assetModules = stats.modules.filter(function (m) { return m.assets.length; });
var fileToIndex = function (file) { return manifest.all.indexOf(file); };
var fileToIndex = function (asset) { return manifest.all.indexOf(getAssetName(asset)); };
stats.modules.forEach(function (m) {
// ignore modules duplicated in multiple chunks
if (m.chunks.length === 1) {
Expand All @@ -71,7 +104,7 @@ VueSSRClientPlugin.prototype.apply = function apply (compiler) {
if (!chunk || !chunk.files) {
return
}
var id = m.identifier.replace(/\s\w+$/, ''); // remove appended hash
var id = stripModuleIdHash(m.identifier);
var files = manifest.modules[hash(id)] = chunk.files.map(fileToIndex);
// find all asset modules associated with the same chunk
assetModules.forEach(function (m) {
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-server-renderer/package.json
@@ -1,6 +1,6 @@
{
"name": "vue-server-renderer",
"version": "2.6.13",
"version": "2.6.14",
"description": "server renderer for Vue 2.0",
"main": "index.js",
"types": "types/index.d.ts",
Expand Down

0 comments on commit 8f6c4c3

Please sign in to comment.