1
0
Fork 0
mirror of https://github.com/vuejs/vue.git synced 2024-12-03 01:00:45 +01:00

build: build 2.6.14

This commit is contained in:
Eduardo San Martin Morote 2021-06-07 11:55:26 +02:00
parent c52427b0d2
commit 8f6c4c3dbd
19 changed files with 119 additions and 53 deletions

View file

@ -1,5 +1,5 @@
/*!
* Vue.js v2.6.13
* Vue.js v2.6.14
* (c) 2014-2021 Evan You
* Released under the MIT License.
*/
@ -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
};
@ -5483,7 +5483,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
value: FunctionalRenderContext
});
Vue.version = '2.6.13';
Vue.version = '2.6.14';
/* */

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,5 @@
/*!
* Vue.js v2.6.13
* Vue.js v2.6.14
* (c) 2014-2021 Evan You
* Released under the MIT License.
*/
@ -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
};
@ -5508,7 +5508,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
value: FunctionalRenderContext
});
Vue.version = '2.6.13';
Vue.version = '2.6.14';
/* */

File diff suppressed because one or more lines are too long

6
dist/vue.esm.js vendored
View file

@ -1,5 +1,5 @@
/*!
* Vue.js v2.6.13
* Vue.js v2.6.14
* (c) 2014-2021 Evan You
* Released under the MIT License.
*/
@ -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
};
@ -5503,7 +5503,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
value: FunctionalRenderContext
});
Vue.version = '2.6.13';
Vue.version = '2.6.14';
/* */

6
dist/vue.js vendored
View file

@ -1,5 +1,5 @@
/*!
* Vue.js v2.6.13
* Vue.js v2.6.14
* (c) 2014-2021 Evan You
* Released under the MIT License.
*/
@ -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
};
@ -5487,7 +5487,7 @@
value: FunctionalRenderContext
});
Vue.version = '2.6.13';
Vue.version = '2.6.14';
/* */

4
dist/vue.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,5 @@
/*!
* Vue.js v2.6.13
* Vue.js v2.6.14
* (c) 2014-2021 Evan You
* Released under the MIT License.
*/
@ -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
};
@ -5474,7 +5474,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
value: FunctionalRenderContext
});
Vue.version = '2.6.13';
Vue.version = '2.6.14';
/* */

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,5 @@
/*!
* Vue.js v2.6.13
* Vue.js v2.6.14
* (c) 2014-2021 Evan You
* Released under the MIT License.
*/
@ -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
};
@ -5494,7 +5494,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
value: FunctionalRenderContext
});
Vue.version = '2.6.13';
Vue.version = '2.6.14';
/* */

6
dist/vue.runtime.js vendored
View file

@ -1,5 +1,5 @@
/*!
* Vue.js v2.6.13
* Vue.js v2.6.14
* (c) 2014-2021 Evan You
* Released under the MIT License.
*/
@ -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
};
@ -5478,7 +5478,7 @@
value: FunctionalRenderContext
});
Vue.version = '2.6.13';
Vue.version = '2.6.14';
/* */

File diff suppressed because one or more lines are too long

View file

@ -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
};

View file

@ -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
};

File diff suppressed because one or more lines are too long

View file

@ -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 {
@ -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');
@ -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
@ -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
@ -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) {
@ -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) {

View file

@ -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",

View file

@ -7,18 +7,29 @@ var isJS = function (file) { return /\.js(\?[^.]+)?$/.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 isWebpack5 = !!(webpack.version && webpack.version[0] > 4);
var validate = function (compiler) {
if (compiler.options.target !== 'node') {
warn('webpack config `target` should be "node".');
}
if (compiler.options.output && compiler.options.output.libraryTarget !== 'commonjs2') {
warn('webpack config `output.libraryTarget` should be "commonjs2".');
if (compiler.options.output) {
if (compiler.options.output.library) {
// Webpack >= 5.0.0
if (compiler.options.output.library.type !== 'commonjs2') {
warn('webpack config `output.library.type` should be "commonjs2".');
}
} else if (compiler.options.output.libraryTarget !== 'commonjs2') {
// Webpack < 5.0.0
warn('webpack config `output.libraryTarget` should be "commonjs2".');
}
}
if (!compiler.options.externals) {
@ -29,8 +40,20 @@ var validate = function (compiler) {
}
};
var onEmit = function (compiler, name, hook) {
if (compiler.hooks) {
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 {
@ -39,6 +62,13 @@ var onEmit = function (compiler, name, hook) {
}
};
var getAssetName = function (asset) {
if (typeof asset === 'string') {
return asset
}
return asset.name
};
var VueSSRServerPlugin = function VueSSRServerPlugin (options) {
if ( options === void 0 ) options = {};
@ -52,7 +82,8 @@ VueSSRServerPlugin.prototype.apply = function apply (compiler) {
validate(compiler);
onEmit(compiler, 'vue-server-plugin', function (compilation, cb) {
var stage = 'PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER';
onEmit(compiler, 'vue-server-plugin', stage, function (compilation, cb) {
var stats = compilation.getStats().toJson();
var entryName = Object.keys(stats.entrypoints)[0];
var entryInfo = stats.entrypoints[entryName];
@ -62,7 +93,9 @@ VueSSRServerPlugin.prototype.apply = function apply (compiler) {
return cb()
}
var entryAssets = entryInfo.assets.filter(isJS);
var entryAssets = entryInfo.assets
.map(getAssetName)
.filter(isJS);
if (entryAssets.length > 1) {
throw new Error(
@ -84,14 +117,14 @@ VueSSRServerPlugin.prototype.apply = function apply (compiler) {
maps: {}
};
stats.assets.forEach(function (asset) {
if (isJS(asset.name)) {
bundle.files[asset.name] = compilation.assets[asset.name].source();
} else if (asset.name.match(/\.js\.map$/)) {
bundle.maps[asset.name.replace(/\.map$/, '')] = JSON.parse(compilation.assets[asset.name].source());
Object.keys(compilation.assets).forEach(function (name) {
if (isJS(name)) {
bundle.files[name] = compilation.assets[name].source();
} else if (name.match(/\.js\.map$/)) {
bundle.maps[name.replace(/\.map$/, '')] = JSON.parse(compilation.assets[name].source());
}
// do not emit anything else for server
delete compilation.assets[asset.name];
delete compilation.assets[name];
});
var json = JSON.stringify(bundle, null, 2);

View file

@ -1,6 +1,6 @@
{
"name": "vue-template-compiler",
"version": "2.6.13",
"version": "2.6.14",
"description": "template compiler for Vue 2.0",
"main": "index.js",
"unpkg": "browser.js",