Skip to content

Commit 8f6c4c3

Browse files
committedJun 7, 2021
build: build 2.6.14
1 parent c52427b commit 8f6c4c3

19 files changed

+119
-53
lines changed
 

‎dist/vue.common.dev.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Vue.js v2.6.13
2+
* Vue.js v2.6.14
33
* (c) 2014-2021 Evan You
44
* Released under the MIT License.
55
*/
@@ -2612,7 +2612,7 @@ function normalizeScopedSlot(normalSlots, key, fn) {
26122612
var vnode = res && res[0];
26132613
return res && (
26142614
!vnode ||
2615-
(vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
2615+
(res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
26162616
) ? undefined
26172617
: res
26182618
};
@@ -5483,7 +5483,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
54835483
value: FunctionalRenderContext
54845484
});
54855485

5486-
Vue.version = '2.6.13';
5486+
Vue.version = '2.6.14';
54875487

54885488
/* */
54895489

‎dist/vue.common.prod.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/vue.esm.browser.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Vue.js v2.6.13
2+
* Vue.js v2.6.14
33
* (c) 2014-2021 Evan You
44
* Released under the MIT License.
55
*/
@@ -2640,7 +2640,7 @@ function normalizeScopedSlot(normalSlots, key, fn) {
26402640
let vnode = res && res[0];
26412641
return res && (
26422642
!vnode ||
2643-
(vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
2643+
(res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
26442644
) ? undefined
26452645
: res
26462646
};
@@ -5508,7 +5508,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
55085508
value: FunctionalRenderContext
55095509
});
55105510

5511-
Vue.version = '2.6.13';
5511+
Vue.version = '2.6.14';
55125512

55135513
/* */
55145514

‎dist/vue.esm.browser.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/vue.esm.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Vue.js v2.6.13
2+
* Vue.js v2.6.14
33
* (c) 2014-2021 Evan You
44
* Released under the MIT License.
55
*/
@@ -2618,7 +2618,7 @@ function normalizeScopedSlot(normalSlots, key, fn) {
26182618
var vnode = res && res[0];
26192619
return res && (
26202620
!vnode ||
2621-
(vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
2621+
(res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
26222622
) ? undefined
26232623
: res
26242624
};
@@ -5503,7 +5503,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
55035503
value: FunctionalRenderContext
55045504
});
55055505

5506-
Vue.version = '2.6.13';
5506+
Vue.version = '2.6.14';
55075507

55085508
/* */
55095509

‎dist/vue.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Vue.js v2.6.13
2+
* Vue.js v2.6.14
33
* (c) 2014-2021 Evan You
44
* Released under the MIT License.
55
*/
@@ -2616,7 +2616,7 @@
26162616
var vnode = res && res[0];
26172617
return res && (
26182618
!vnode ||
2619-
(vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
2619+
(res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
26202620
) ? undefined
26212621
: res
26222622
};
@@ -5487,7 +5487,7 @@
54875487
value: FunctionalRenderContext
54885488
});
54895489

5490-
Vue.version = '2.6.13';
5490+
Vue.version = '2.6.14';
54915491

54925492
/* */
54935493

‎dist/vue.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/vue.runtime.common.dev.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Vue.js v2.6.13
2+
* Vue.js v2.6.14
33
* (c) 2014-2021 Evan You
44
* Released under the MIT License.
55
*/
@@ -2603,7 +2603,7 @@ function normalizeScopedSlot(normalSlots, key, fn) {
26032603
var vnode = res && res[0];
26042604
return res && (
26052605
!vnode ||
2606-
(vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
2606+
(res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
26072607
) ? undefined
26082608
: res
26092609
};
@@ -5474,7 +5474,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
54745474
value: FunctionalRenderContext
54755475
});
54765476

5477-
Vue.version = '2.6.13';
5477+
Vue.version = '2.6.14';
54785478

54795479
/* */
54805480

‎dist/vue.runtime.common.prod.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/vue.runtime.esm.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Vue.js v2.6.13
2+
* Vue.js v2.6.14
33
* (c) 2014-2021 Evan You
44
* Released under the MIT License.
55
*/
@@ -2609,7 +2609,7 @@ function normalizeScopedSlot(normalSlots, key, fn) {
26092609
var vnode = res && res[0];
26102610
return res && (
26112611
!vnode ||
2612-
(vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
2612+
(res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
26132613
) ? undefined
26142614
: res
26152615
};
@@ -5494,7 +5494,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
54945494
value: FunctionalRenderContext
54955495
});
54965496

5497-
Vue.version = '2.6.13';
5497+
Vue.version = '2.6.14';
54985498

54995499
/* */
55005500

‎dist/vue.runtime.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Vue.js v2.6.13
2+
* Vue.js v2.6.14
33
* (c) 2014-2021 Evan You
44
* Released under the MIT License.
55
*/
@@ -2607,7 +2607,7 @@
26072607
var vnode = res && res[0];
26082608
return res && (
26092609
!vnode ||
2610-
(vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
2610+
(res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
26112611
) ? undefined
26122612
: res
26132613
};
@@ -5478,7 +5478,7 @@
54785478
value: FunctionalRenderContext
54795479
});
54805480

5481-
Vue.version = '2.6.13';
5481+
Vue.version = '2.6.14';
54825482

54835483
/* */
54845484

‎dist/vue.runtime.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎packages/vue-server-renderer/basic.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7666,7 +7666,7 @@
76667666
var vnode = res && res[0];
76677667
return res && (
76687668
!vnode ||
7669-
(vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
7669+
(res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
76707670
) ? undefined
76717671
: res
76727672
};

‎packages/vue-server-renderer/build.dev.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7416,7 +7416,7 @@ function normalizeScopedSlot(normalSlots, key, fn) {
74167416
var vnode = res && res[0];
74177417
return res && (
74187418
!vnode ||
7419-
(vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
7419+
(res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
74207420
) ? undefined
74217421
: res
74227422
};

‎packages/vue-server-renderer/build.prod.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎packages/vue-server-renderer/client-plugin.js

+38-5
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,28 @@ var isCSS = function (file) { return /\.css(\?[^.]+)?$/.test(file); };
99
var ref = require('chalk');
1010
var red = ref.red;
1111
var yellow = ref.yellow;
12+
var webpack = require('webpack');
1213

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

17-
var onEmit = function (compiler, name, hook) {
18-
if (compiler.hooks) {
18+
var isWebpack5 = !!(webpack.version && webpack.version[0] > 4);
19+
20+
var onEmit = function (compiler, name, stageName, hook) {
21+
if (isWebpack5) {
22+
// Webpack >= 5.0.0
23+
compiler.hooks.compilation.tap(name, function (compilation) {
24+
if (compilation.compiler !== compiler) {
25+
// Ignore child compilers
26+
return
27+
}
28+
var stage = webpack.Compilation[stageName];
29+
compilation.hooks.processAssets.tapAsync({ name: name, stage: stage }, function (assets, cb) {
30+
hook(compilation, cb);
31+
});
32+
});
33+
} else if (compiler.hooks) {
1934
// Webpack >= 4.0.0
2035
compiler.hooks.emit.tapAsync(name, hook);
2136
} else {
@@ -24,6 +39,22 @@ var onEmit = function (compiler, name, hook) {
2439
}
2540
};
2641

42+
var stripModuleIdHash = function (id) {
43+
if (isWebpack5) {
44+
// Webpack >= 5.0.0
45+
return id.replace(/\|\w+$/, '')
46+
}
47+
// Webpack < 5.0.0
48+
return id.replace(/\s\w+$/, '')
49+
};
50+
51+
var getAssetName = function (asset) {
52+
if (typeof asset === 'string') {
53+
return asset
54+
}
55+
return asset.name
56+
};
57+
2758
var hash = require('hash-sum');
2859
var uniq = require('lodash.uniq');
2960

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

41-
onEmit(compiler, 'vue-client-plugin', function (compilation, cb) {
72+
var stage = 'PROCESS_ASSETS_STAGE_ADDITIONAL';
73+
onEmit(compiler, 'vue-client-plugin', stage, function (compilation, cb) {
4274
var stats = compilation.getStats().toJson();
4375

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

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

6497
var assetModules = stats.modules.filter(function (m) { return m.assets.length; });
65-
var fileToIndex = function (file) { return manifest.all.indexOf(file); };
98+
var fileToIndex = function (asset) { return manifest.all.indexOf(getAssetName(asset)); };
6699
stats.modules.forEach(function (m) {
67100
// ignore modules duplicated in multiple chunks
68101
if (m.chunks.length === 1) {
@@ -71,7 +104,7 @@ VueSSRClientPlugin.prototype.apply = function apply (compiler) {
71104
if (!chunk || !chunk.files) {
72105
return
73106
}
74-
var id = m.identifier.replace(/\s\w+$/, ''); // remove appended hash
107+
var id = stripModuleIdHash(m.identifier);
75108
var files = manifest.modules[hash(id)] = chunk.files.map(fileToIndex);
76109
// find all asset modules associated with the same chunk
77110
assetModules.forEach(function (m) {

‎packages/vue-server-renderer/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-server-renderer",
3-
"version": "2.6.13",
3+
"version": "2.6.14",
44
"description": "server renderer for Vue 2.0",
55
"main": "index.js",
66
"types": "types/index.d.ts",

‎packages/vue-server-renderer/server-plugin.js

+45-12
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,29 @@ var isJS = function (file) { return /\.js(\?[^.]+)?$/.test(file); };
77
var ref = require('chalk');
88
var red = ref.red;
99
var yellow = ref.yellow;
10+
var webpack = require('webpack');
1011

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

16+
var isWebpack5 = !!(webpack.version && webpack.version[0] > 4);
17+
1518
var validate = function (compiler) {
1619
if (compiler.options.target !== 'node') {
1720
warn('webpack config `target` should be "node".');
1821
}
1922

20-
if (compiler.options.output && compiler.options.output.libraryTarget !== 'commonjs2') {
21-
warn('webpack config `output.libraryTarget` should be "commonjs2".');
23+
if (compiler.options.output) {
24+
if (compiler.options.output.library) {
25+
// Webpack >= 5.0.0
26+
if (compiler.options.output.library.type !== 'commonjs2') {
27+
warn('webpack config `output.library.type` should be "commonjs2".');
28+
}
29+
} else if (compiler.options.output.libraryTarget !== 'commonjs2') {
30+
// Webpack < 5.0.0
31+
warn('webpack config `output.libraryTarget` should be "commonjs2".');
32+
}
2233
}
2334

2435
if (!compiler.options.externals) {
@@ -29,8 +40,20 @@ var validate = function (compiler) {
2940
}
3041
};
3142

32-
var onEmit = function (compiler, name, hook) {
33-
if (compiler.hooks) {
43+
var onEmit = function (compiler, name, stageName, hook) {
44+
if (isWebpack5) {
45+
// Webpack >= 5.0.0
46+
compiler.hooks.compilation.tap(name, function (compilation) {
47+
if (compilation.compiler !== compiler) {
48+
// Ignore child compilers
49+
return
50+
}
51+
var stage = webpack.Compilation[stageName];
52+
compilation.hooks.processAssets.tapAsync({ name: name, stage: stage }, function (assets, cb) {
53+
hook(compilation, cb);
54+
});
55+
});
56+
} else if (compiler.hooks) {
3457
// Webpack >= 4.0.0
3558
compiler.hooks.emit.tapAsync(name, hook);
3659
} else {
@@ -39,6 +62,13 @@ var onEmit = function (compiler, name, hook) {
3962
}
4063
};
4164

65+
var getAssetName = function (asset) {
66+
if (typeof asset === 'string') {
67+
return asset
68+
}
69+
return asset.name
70+
};
71+
4272
var VueSSRServerPlugin = function VueSSRServerPlugin (options) {
4373
if ( options === void 0 ) options = {};
4474

@@ -52,7 +82,8 @@ VueSSRServerPlugin.prototype.apply = function apply (compiler) {
5282

5383
validate(compiler);
5484

55-
onEmit(compiler, 'vue-server-plugin', function (compilation, cb) {
85+
var stage = 'PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER';
86+
onEmit(compiler, 'vue-server-plugin', stage, function (compilation, cb) {
5687
var stats = compilation.getStats().toJson();
5788
var entryName = Object.keys(stats.entrypoints)[0];
5889
var entryInfo = stats.entrypoints[entryName];
@@ -62,7 +93,9 @@ VueSSRServerPlugin.prototype.apply = function apply (compiler) {
6293
return cb()
6394
}
6495

65-
var entryAssets = entryInfo.assets.filter(isJS);
96+
var entryAssets = entryInfo.assets
97+
.map(getAssetName)
98+
.filter(isJS);
6699

67100
if (entryAssets.length > 1) {
68101
throw new Error(
@@ -84,14 +117,14 @@ VueSSRServerPlugin.prototype.apply = function apply (compiler) {
84117
maps: {}
85118
};
86119

87-
stats.assets.forEach(function (asset) {
88-
if (isJS(asset.name)) {
89-
bundle.files[asset.name] = compilation.assets[asset.name].source();
90-
} else if (asset.name.match(/\.js\.map$/)) {
91-
bundle.maps[asset.name.replace(/\.map$/, '')] = JSON.parse(compilation.assets[asset.name].source());
120+
Object.keys(compilation.assets).forEach(function (name) {
121+
if (isJS(name)) {
122+
bundle.files[name] = compilation.assets[name].source();
123+
} else if (name.match(/\.js\.map$/)) {
124+
bundle.maps[name.replace(/\.map$/, '')] = JSON.parse(compilation.assets[name].source());
92125
}
93126
// do not emit anything else for server
94-
delete compilation.assets[asset.name];
127+
delete compilation.assets[name];
95128
});
96129

97130
var json = JSON.stringify(bundle, null, 2);

‎packages/vue-template-compiler/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-template-compiler",
3-
"version": "2.6.13",
3+
"version": "2.6.14",
44
"description": "template compiler for Vue 2.0",
55
"main": "index.js",
66
"unpkg": "browser.js",

0 commit comments

Comments
 (0)
Please sign in to comment.