Browse Source

build: ship pre-minified versions of CommonJS build and server renderer

dev
Evan You 6 years ago
parent
commit
17296aa6bb
  1. 6
      benchmarks/ssr/common.js
  2. 11092
      dist/vue.common.js
  3. 2
      dist/vue.min.js
  4. 8117
      dist/vue.runtime.common.js
  5. 149
      packages/vue-server-renderer/build.dev.js
  6. 1
      packages/vue-server-renderer/build.prod.js
  7. 6
      packages/vue-server-renderer/index.js
  8. 3
      scripts/build.js
  9. 37
      scripts/config.js

6
benchmarks/ssr/common.js

@ -1,6 +1,6 @@
'use strict'
const self = (global || root)
const self = (global || root) // eslint-disable-line
self.performance = {
now: function () {
@ -35,11 +35,11 @@ module.exports = {
}
},
// template: '<table><tr v-for="row in grid"><th>123</th><td v-for="item in row.items">{{ item.id }}</td></tr></table>',
template: '<table width="100%" cellspacing="2"><row v-for="row in grid" :row="row"></row></table>',
template: '<table width="100%" cellspacing="2"><row v-for="row in grid" :key="row.id" :row="row"></row></table>',
components: {
row: {
props: ['row'],
template: '<tr><th>{{ Math.random() }}</th><column v-for="item in row.items"></column></tr>',
template: '<tr><th>{{ Math.random() }}</th><column v-for="item in row.items" :key="item.id"></column></tr>',
components: {
column: {
template: '<td class="item">' +

11092
dist/vue.common.js

File diff suppressed because it is too large

2
dist/vue.min.js

File diff suppressed because one or more lines are too long

8117
dist/vue.runtime.common.js

File diff suppressed because it is too large

149
packages/vue-server-renderer/build.js → packages/vue-server-renderer/build.dev.js

@ -733,12 +733,12 @@ var config = ({
/**
* Show production mode tip message on boot?
*/
productionTip: process.env.NODE_ENV !== 'production',
productionTip: "development" !== 'production',
/**
* Whether to enable devtools
*/
devtools: process.env.NODE_ENV !== 'production',
devtools: "development" !== 'production',
/**
* Whether to record perf
@ -819,7 +819,7 @@ var tip = noop;
var generateComponentTrace = (noop); // work around flow check
var formatComponentName = (noop);
if (process.env.NODE_ENV !== 'production') {
{
var hasConsole = typeof console !== 'undefined';
var classifyRE = /(?:^|[-_])(\w)/g;
var classify = function (str) { return str
@ -934,12 +934,6 @@ Dep.prototype.depend = function depend () {
Dep.prototype.notify = function notify () {
// stabilize the subscriber list first
var subs = this.subs.slice();
if (process.env.NODE_ENV !== 'production' && !config.async) {
// subs aren't sorted in scheduler if not running async
// we need to sort them now to make sure they fire in correct
// order
subs.sort(function (a, b) { return a.id - b.id; });
}
for (var i = 0, l = subs.length; i < l; i++) {
subs[i].update();
}
@ -1165,7 +1159,7 @@ function defineReactive$$1 (
return
}
/* eslint-enable no-self-compare */
if (process.env.NODE_ENV !== 'production' && customSetter) {
if (customSetter) {
customSetter();
}
// #7981: for accessor properties without setter
@ -1187,8 +1181,7 @@ function defineReactive$$1 (
* already exist.
*/
function set (target, key, val) {
if (process.env.NODE_ENV !== 'production' &&
(isUndef(target) || isPrimitive(target))
if (isUndef(target) || isPrimitive(target)
) {
warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
}
@ -1203,7 +1196,7 @@ function set (target, key, val) {
}
var ob = (target).__ob__;
if (target._isVue || (ob && ob.vmCount)) {
process.env.NODE_ENV !== 'production' && warn(
warn(
'Avoid adding reactive properties to a Vue instance or its root $data ' +
'at runtime - declare it upfront in the data option.'
);
@ -1244,7 +1237,7 @@ var strats = config.optionMergeStrategies;
/**
* Options with restrictions
*/
if (process.env.NODE_ENV !== 'production') {
{
strats.el = strats.propsData = function (parent, child, vm, key) {
if (!vm) {
warn(
@ -1332,7 +1325,7 @@ strats.data = function (
) {
if (!vm) {
if (childVal && typeof childVal !== 'function') {
process.env.NODE_ENV !== 'production' && warn(
warn(
'The "data" option should be a function ' +
'that returns a per-instance value in component ' +
'definitions.',
@ -1382,7 +1375,7 @@ function mergeAssets (
) {
var res = Object.create(parentVal || null);
if (childVal) {
process.env.NODE_ENV !== 'production' && assertObjectType(key, childVal, vm);
assertObjectType(key, childVal, vm);
return extend(res, childVal)
} else {
return res
@ -1410,7 +1403,7 @@ strats.watch = function (
if (childVal === nativeWatch) { childVal = undefined; }
/* istanbul ignore if */
if (!childVal) { return Object.create(parentVal || null) }
if (process.env.NODE_ENV !== 'production') {
{
assertObjectType(key, childVal, vm);
}
if (!parentVal) { return childVal }
@ -1441,7 +1434,7 @@ strats.computed = function (
vm,
key
) {
if (childVal && process.env.NODE_ENV !== 'production') {
if (childVal && "development" !== 'production') {
assertObjectType(key, childVal, vm);
}
if (!parentVal) { return childVal }
@ -1502,7 +1495,7 @@ function normalizeProps (options, vm) {
if (typeof val === 'string') {
name = camelize(val);
res[name] = { type: null };
} else if (process.env.NODE_ENV !== 'production') {
} else {
warn('props must be strings when using array syntax.');
}
}
@ -1514,7 +1507,7 @@ function normalizeProps (options, vm) {
? val
: { type: val };
}
} else if (process.env.NODE_ENV !== 'production') {
} else {
warn(
"Invalid value for option \"props\": expected an Array or an Object, " +
"but got " + (toRawType(props)) + ".",
@ -1542,7 +1535,7 @@ function normalizeInject (options, vm) {
? extend({ from: key }, val)
: { from: val };
}
} else if (process.env.NODE_ENV !== 'production') {
} else {
warn(
"Invalid value for option \"inject\": expected an Array or an Object, " +
"but got " + (toRawType(inject)) + ".",
@ -1585,7 +1578,7 @@ function mergeOptions (
child,
vm
) {
if (process.env.NODE_ENV !== 'production') {
{
checkComponents(child);
}
@ -1653,7 +1646,7 @@ function resolveAsset (
if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
// fallback to prototype chain
var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
if (process.env.NODE_ENV !== 'production' && warnMissing && !res) {
if (warnMissing && !res) {
warn(
'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
options
@ -1699,11 +1692,7 @@ function validateProp (
observe(value);
toggleObserving(prevShouldObserve);
}
if (
process.env.NODE_ENV !== 'production' &&
// skip validation for weex recycle-list child component props
!(false)
) {
{
assertProp(prop, key, value, vm, absent);
}
return value
@ -1719,7 +1708,7 @@ function getPropDefaultValue (vm, prop, key) {
}
var def = prop.default;
// warn against non-factory defaults for Object & Array
if (process.env.NODE_ENV !== 'production' && isObject(def)) {
if (isObject(def)) {
warn(
'Invalid default value for prop "' + key + '": ' +
'Props with type Object/Array must use a factory function ' +
@ -1915,7 +1904,7 @@ function globalHandleError (err, vm, info) {
}
function logError (err, vm, info) {
if (process.env.NODE_ENV !== 'production') {
{
warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
}
/* istanbul ignore else */
@ -2719,7 +2708,7 @@ function addHandler (
// warn prevent and passive modifier
/* istanbul ignore if */
if (
process.env.NODE_ENV !== 'production' && warn &&
warn &&
modifiers.prevent && modifiers.passive
) {
warn(
@ -2831,7 +2820,7 @@ function getAndRemoveAttr (
function transformNode (el, options) {
var warn = options.warn || baseWarn;
var staticClass = getAndRemoveAttr(el, 'class');
if (process.env.NODE_ENV !== 'production' && staticClass) {
if (staticClass) {
var res = parseText(staticClass, options.delimiters);
if (res) {
warn(
@ -2875,7 +2864,7 @@ function transformNode$1 (el, options) {
var staticStyle = getAndRemoveAttr(el, 'style');
if (staticStyle) {
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production') {
{
var res = parseText(staticStyle, options.delimiters);
if (res) {
warn(
@ -3070,7 +3059,7 @@ function parseHTML (html, options) {
if (html === last) {
options.chars && options.chars(html);
if (process.env.NODE_ENV !== 'production' && !stack.length && options.warn) {
if (!stack.length && options.warn) {
options.warn(("Mal-formatted tag at end of template: \"" + html + "\""));
}
break
@ -3168,8 +3157,7 @@ function parseHTML (html, options) {
if (pos >= 0) {
// Close all the open elements, up the stack
for (var i = stack.length - 1; i >= pos; i--) {
if (process.env.NODE_ENV !== 'production' &&
(i > pos || !tagName) &&
if (i > pos || !tagName &&
options.warn
) {
options.warn(
@ -3462,7 +3450,7 @@ function parse (
if (isForbiddenTag(element) && !isServerRendering()) {
element.forbidden = true;
process.env.NODE_ENV !== 'production' && warn$1(
warn$1(
'Templates should only be responsible for mapping the state to the ' +
'UI. Avoid placing tags with side-effects in your templates, such as ' +
"<" + tag + ">" + ', as they will not be parsed.'
@ -3495,7 +3483,7 @@ function parse (
}
function checkRootConstraints (el) {
if (process.env.NODE_ENV !== 'production') {
{
if (el.tag === 'slot' || el.tag === 'template') {
warnOnce(
"Cannot use <" + (el.tag) + "> as component root element because it may " +
@ -3523,7 +3511,7 @@ function parse (
exp: element.elseif,
block: element
});
} else if (process.env.NODE_ENV !== 'production') {
} else {
warnOnce(
"Component template should contain exactly one root element. " +
"If you are using v-if on multiple elements, " +
@ -3566,7 +3554,7 @@ function parse (
chars: function chars (text) {
if (!currentParent) {
if (process.env.NODE_ENV !== 'production') {
{
if (text === template) {
warnOnce(
'Component template requires a root element, rather than just text.'
@ -3661,7 +3649,7 @@ function processElement (element, options) {
function processKey (el) {
var exp = getBindingAttr(el, 'key');
if (exp) {
if (process.env.NODE_ENV !== 'production') {
{
if (el.tag === 'template') {
warn$1("<template> cannot be keyed. Place the key on real elements instead.");
}
@ -3694,7 +3682,7 @@ function processFor (el) {
var res = parseFor(exp);
if (res) {
extend(el, res);
} else if (process.env.NODE_ENV !== 'production') {
} else {
warn$1(
("Invalid v-for expression: " + exp)
);
@ -3749,7 +3737,7 @@ function processIfConditions (el, parent) {
exp: el.elseif,
block: el
});
} else if (process.env.NODE_ENV !== 'production') {
} else {
warn$1(
"v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " +
"used on element <" + (el.tag) + "> without corresponding v-if."
@ -3763,7 +3751,7 @@ function findPrevElement (children) {
if (children[i].type === 1) {
return children[i]
} else {
if (process.env.NODE_ENV !== 'production' && children[i].text !== ' ') {
if (children[i].text !== ' ') {
warn$1(
"text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " +
"will be ignored."
@ -3791,7 +3779,7 @@ function processOnce (el) {
function processSlot (el) {
if (el.tag === 'slot') {
el.slotName = getBindingAttr(el, 'name');
if (process.env.NODE_ENV !== 'production' && el.key) {
if (el.key) {
warn$1(
"`key` does not work on <slot> because slots are abstract outlets " +
"and can possibly expand into multiple elements. " +
@ -3803,7 +3791,7 @@ function processSlot (el) {
if (el.tag === 'template') {
slotScope = getAndRemoveAttr(el, 'scope');
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && slotScope) {
if (slotScope) {
warn$1(
"the \"scope\" attribute for scoped slots have been deprecated and " +
"replaced by \"slot-scope\" since 2.5. The new \"slot-scope\" attribute " +
@ -3815,7 +3803,7 @@ function processSlot (el) {
el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope');
} else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && el.attrsMap['v-for']) {
if (el.attrsMap['v-for']) {
warn$1(
"Ambiguous combined usage of slot-scope and v-for on <" + (el.tag) + "> " +
"(v-for takes higher priority). Use a wrapper <template> for the " +
@ -3866,7 +3854,6 @@ function processAttrs (el) {
value = parseFilters(value);
isProp = false;
if (
process.env.NODE_ENV !== 'production' &&
value.trim().length === 0
) {
warn$1(
@ -3909,13 +3896,13 @@ function processAttrs (el) {
name = name.slice(0, -(arg.length + 1));
}
addDirective(el, name, rawName, value, arg, modifiers);
if (process.env.NODE_ENV !== 'production' && name === 'model') {
if (name === 'model') {
checkForAliasModel(el, value);
}
}
} else {
// literal attribute
if (process.env.NODE_ENV !== 'production') {
{
var res = parseText(value, delimiters);
if (res) {
warn$1(
@ -3962,7 +3949,6 @@ function makeAttrsMap (attrs) {
var map = {};
for (var i = 0, l = attrs.length; i < l; i++) {
if (
process.env.NODE_ENV !== 'production' &&
map[attrs[i].name] && !isIE && !isEdge
) {
warn$1('duplicate attribute: ' + attrs[i].name);
@ -4116,7 +4102,7 @@ function model$2 (
var tag = el.tag;
var type = el.attrsMap.type;
if (process.env.NODE_ENV !== 'production') {
{
// inputs with type="file" are read only and setting the input's
// value will throw an error.
if (tag === 'input' && type === 'file') {
@ -4218,7 +4204,7 @@ function genDefaultModel (
// warn if v-bind:value conflicts with v-model
// except for inputs with v-bind:type
if (process.env.NODE_ENV !== 'production') {
{
var value$1 = el.attrsMap['v-bind:value'] || el.attrsMap[':value'];
var typeBinding = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];
if (value$1 && !typeBinding) {
@ -4445,7 +4431,7 @@ function genFilterCode (key) {
/* */
function on (el, dir) {
if (process.env.NODE_ENV !== 'production' && dir.modifiers) {
if (dir.modifiers) {
warn("v-on without argument does not support modifiers.");
}
el.wrapListeners = function (code) { return ("_g(" + code + "," + (dir.value) + ")"); };
@ -4570,7 +4556,7 @@ function genOnce (el, state) {
parent = parent.parent;
}
if (!key) {
process.env.NODE_ENV !== 'production' && state.warn(
state.warn(
"v-once can only be used inside v-for that is keyed. "
);
return genElement(el, state)
@ -4629,8 +4615,7 @@ function genFor (
var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
if (process.env.NODE_ENV !== 'production' &&
state.maybeComponent(el) &&
if (state.maybeComponent(el) &&
el.tag !== 'slot' &&
el.tag !== 'template' &&
!el.key
@ -4755,9 +4740,7 @@ function genDirectives (el, state) {
function genInlineTemplate (el, state) {
var ast = el.children[0];
if (process.env.NODE_ENV !== 'production' && (
el.children.length !== 1 || ast.type !== 1
)) {
if (el.children.length !== 1 || ast.type !== 1) {
state.warn('Inline-template components must have exactly one child element.');
}
if (ast.type === 1) {
@ -5536,7 +5519,7 @@ function createCompileToFunctionFn (compile) {
delete options.warn;
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production') {
{
// detect possible CSP restriction
try {
new Function('return 1');
@ -5565,7 +5548,7 @@ function createCompileToFunctionFn (compile) {
var compiled = compile(template, options);
// check compilation errors/tips
if (process.env.NODE_ENV !== 'production') {
{
if (compiled.errors && compiled.errors.length) {
warn$$1(
"Error compiling template:\n\n" + template + "\n\n" +
@ -5590,7 +5573,7 @@ function createCompileToFunctionFn (compile) {
// this should only happen if there is a bug in the compiler itself.
// mostly for codegen development use
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production') {
{
if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) {
warn$$1(
"Failed to generate render function:\n\n" +
@ -5646,7 +5629,7 @@ function createCompilerCreator (baseCompile) {
}
var compiled = baseCompile(template, finalOptions);
if (process.env.NODE_ENV !== 'production') {
{
errors.push.apply(errors, detectErrors(compiled.ast));
}
compiled.errors = errors;
@ -5895,7 +5878,7 @@ function renderSSRStyle (
/* not type checking this file because flow doesn't play well with Proxy */
if (process.env.NODE_ENV !== 'production') {
{
var allowedGlobals = makeMap(
'Infinity,undefined,NaN,isFinite,isNaN,' +
'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
@ -5959,7 +5942,7 @@ function _traverse (val, seen) {
}
}
if (process.env.NODE_ENV !== 'production') {
{
var perf = inBrowser && window.performance;
/* istanbul ignore if */
if (
@ -6021,7 +6004,7 @@ function updateListeners (
old = oldOn[name];
event = normalizeEvent(name);
if (isUndef(cur)) {
process.env.NODE_ENV !== 'production' && warn(
warn(
"Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
vm
);
@ -6068,7 +6051,7 @@ function extractPropsFromVNodeData (
if (isDef(attrs) || isDef(props)) {
for (var key in propOptions) {
var altKey = hyphenate(key);
if (process.env.NODE_ENV !== 'production') {
{
var keyInLowerCase = key.toLowerCase();
if (
key !== keyInLowerCase &&
@ -6188,7 +6171,7 @@ function resolveAsyncComponent (
});
var reject = once(function (reason) {
process.env.NODE_ENV !== 'production' && warn(
warn(
"Failed to resolve async component: " + (String(factory)) +
(reason ? ("\nReason: " + reason) : '')
);
@ -6231,9 +6214,7 @@ function resolveAsyncComponent (
setTimeout(function () {
if (isUndef(factory.resolved)) {
reject(
process.env.NODE_ENV !== 'production'
? ("timeout (" + (res.timeout) + "ms)")
: null
"timeout (" + (res.timeout) + "ms)"
);
}
}, res.timeout);
@ -6364,7 +6345,6 @@ function updateChildComponent (
parentVnode,
renderChildren
) {
if (process.env.NODE_ENV !== 'production') ;
// determine whether component has slot children
// we need to do this before overwriting $options._renderChildren
@ -6415,8 +6395,6 @@ function updateChildComponent (
vm.$slots = resolveSlots(renderChildren, parentVnode.context);
vm.$forceUpdate();
}
if (process.env.NODE_ENV !== 'production') ;
}
function isInInactiveTree (vm) {
@ -6529,7 +6507,7 @@ function _createElement (
normalizationType
) {
if (isDef(data) && isDef((data).__ob__)) {
process.env.NODE_ENV !== 'production' && warn(
warn(
"Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
'Always create fresh vnode data objects in each render!',
context
@ -6545,8 +6523,7 @@ function _createElement (
return createEmptyVNode()
}
// warn against non-primitive key
if (process.env.NODE_ENV !== 'production' &&
isDef(data) && isDef(data.key) && !isPrimitive(data.key)
if (isDef(data) && isDef(data.key) && !isPrimitive(data.key)
) {
{
warn(
@ -6681,7 +6658,7 @@ function renderSlot (
if (scopedSlotFn) { // scoped slot
props = props || {};
if (bindObject) {
if (process.env.NODE_ENV !== 'production' && !isObject(bindObject)) {
if (!isObject(bindObject)) {
warn(
'slot v-bind without argument expects an Object',
this
@ -6757,7 +6734,7 @@ function bindObjectProps (
) {
if (value) {
if (!isObject(value)) {
process.env.NODE_ENV !== 'production' && warn(
warn(
'v-bind without argument expects an Object or Array value',
this
);
@ -6864,7 +6841,7 @@ function markStaticNode (node, key, isOnce) {
function bindObjectListeners (data, value) {
if (value) {
if (!isPlainObject(value)) {
process.env.NODE_ENV !== 'production' && warn(
warn(
'v-on without argument expects an Object value',
this
);
@ -6932,7 +6909,7 @@ function resolveInject (inject, vm) {
result[key] = typeof provideDefault === 'function'
? provideDefault.call(vm)
: provideDefault;
} else if (process.env.NODE_ENV !== 'production') {
} else {
warn(("Injection \"" + key + "\" not found"), vm);
}
}
@ -7109,7 +7086,7 @@ function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderCo
var clone = cloneVNode(vnode);
clone.fnContext = contextVm;
clone.fnOptions = options;
if (process.env.NODE_ENV !== 'production') {
{
(clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
}
if (data.slot) {
@ -7220,7 +7197,7 @@ function createComponent (
// if at this stage it's not a constructor or an async component factory,
// reject.
if (typeof Ctor !== 'function') {
if (process.env.NODE_ENV !== 'production') {
{
warn(("Invalid Component definition: " + (String(Ctor))), context);
}
return
@ -8126,9 +8103,7 @@ TemplateRenderer.prototype.renderState = function renderState (context, options)
var contextKey = ref.contextKey; if ( contextKey === void 0 ) contextKey = 'state';
var windowKey = ref.windowKey; if ( windowKey === void 0 ) windowKey = '__INITIAL_STATE__';
var state = serialize(context[contextKey], { isJSON: true });
var autoRemove = process.env.NODE_ENV === 'production'
? ';(function(){var s;(s=document.currentScript||document.scripts[document.scripts.length-1]).parentNode.removeChild(s);}());'
: '';
var autoRemove = '';
return context[contextKey]
? ("<script>window." + windowKey + "=" + state + autoRemove + "</script>")
: ''

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

File diff suppressed because one or more lines are too long

6
packages/vue-server-renderer/index.js

@ -13,4 +13,8 @@ if (vueVersion && vueVersion !== packageVersion) {
)
}
module.exports = require('./build')
if (process.env.NODE_ENV === 'production') {
module.exports = require('./build.prod.js')
} else {
module.exports = require('./build.dev.js')
}

3
scripts/build.js

@ -43,12 +43,13 @@ function build (builds) {
function buildEntry (config) {
const output = config.output
const { file, banner } = output
const isProd = /min\.js$/.test(file)
const isProd = /(min|prod)\.js$/.test(file)
return rollup.rollup(config)
.then(bundle => bundle.generate(output))
.then(({ code }) => {
if (isProd) {
const minified = (banner ? banner + '\n' : '') + terser.minify(code, {
toplevel: true,
output: {
ascii_only: true
},

37
scripts/config.js

@ -36,17 +36,34 @@ const resolve = p => {
const builds = {
// Runtime only (CommonJS). Used by bundlers e.g. Webpack & Browserify
'web-runtime-cjs': {
'web-runtime-cjs-dev': {
entry: resolve('web/entry-runtime.js'),
dest: resolve('dist/vue.runtime.common.js'),
dest: resolve('dist/vue.runtime.common.dev.js'),
format: 'cjs',
env: 'development',
banner
},
'web-runtime-cjs-prod': {
entry: resolve('web/entry-runtime.js'),
dest: resolve('dist/vue.runtime.common.prod.js'),
format: 'cjs',
env: 'production',
banner
},
// Runtime+compiler CommonJS build (CommonJS)
'web-full-cjs': {
'web-full-cjs-dev': {
entry: resolve('web/entry-runtime-with-compiler.js'),
dest: resolve('dist/vue.common.js'),
dest: resolve('dist/vue.common.dev.js'),
format: 'cjs',
env: 'development',
alias: { he: './entity-decoder' },
banner
},
'web-full-cjs-prod': {
entry: resolve('web/entry-runtime-with-compiler.js'),
dest: resolve('dist/vue.common.prod.js'),
format: 'cjs',
env: 'production',
alias: { he: './entity-decoder' },
banner
},
@ -117,10 +134,18 @@ const builds = {
plugins: [node(), cjs()]
},
// Web server renderer (CommonJS).
'web-server-renderer': {
'web-server-renderer-dev': {
entry: resolve('web/entry-server-renderer.js'),
dest: resolve('packages/vue-server-renderer/build.js'),
dest: resolve('packages/vue-server-renderer/build.dev.js'),
format: 'cjs',
env: 'development',
external: Object.keys(require('../packages/vue-server-renderer/package.json').dependencies)
},
'web-server-renderer-prod': {
entry: resolve('web/entry-server-renderer.js'),
dest: resolve('packages/vue-server-renderer/build.prod.js'),
format: 'cjs',
env: 'production',
external: Object.keys(require('../packages/vue-server-renderer/package.json').dependencies)
},
'web-server-renderer-basic': {

Loading…
Cancel
Save