Commit 54904661 authored by JC Brand's avatar JC Brand

Add minifier for es2015

parent 8a4aa4ef
......@@ -157,8 +157,6 @@ transpile: stamp-npm src
BUILDS = dist/converse.js \
dist/converse.min.js \
dist/converse-esnext.js \
dist/converse-esnext.min.js \
dist/converse-muc-embedded.js \
dist/converse-muc-embedded.min.js \
dist/converse-no-jquery.js \
......@@ -166,6 +164,11 @@ BUILDS = dist/converse.js \
dist/converse-no-dependencies.min.js \
dist/converse-no-dependencies.js
# XXX: I haven't yet found a ES2015-capable uglifier for this,
# so disabled for now:
# dist/converse-esnext.js \
# dist/converse-esnext.min.js \
dist/converse.js: transpile src node_modules
$(RJS) -o src/build.js include=converse out=dist/converse.js optimize=none
dist/converse.min.js: transpile src node_modules
......
......@@ -530,6 +530,12 @@
"babel-runtime": "6.26.0"
}
},
"babel-plugin-groundskeeper-willie": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/babel-plugin-groundskeeper-willie/-/babel-plugin-groundskeeper-willie-1.3.2.tgz",
"integrity": "sha1-6YMuhlYwy1i3RIIqwzX+tRT9IZ0=",
"dev": true
},
"babel-plugin-syntax-async-functions": {
"version": "6.13.0",
"resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz",
......@@ -804,6 +810,30 @@
"babel-runtime": "6.26.0"
}
},
"babel-plugin-transform-mangle": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-mangle/-/babel-plugin-transform-mangle-0.1.7.tgz",
"integrity": "sha1-3M9JlsSSTuQ2rtHuf9C/1uPGxlU=",
"dev": true
},
"babel-plugin-transform-member-expression-literals": {
"version": "6.8.5",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.8.5.tgz",
"integrity": "sha512-Ux3ligf+ukzWaCbBYOstDuFBhRgMiJHlpJBKV4P47qtzVkd0lg1ddPj9fqIJqAM0n+CvxipyrZrnNnw3CdtQCg==",
"dev": true
},
"babel-plugin-transform-merge-sibling-variables": {
"version": "6.8.6",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.8.6.tgz",
"integrity": "sha512-o5Jioq553HtEAUN5uty7ELJMenXIxHI3PIs1yLqYWYQwP6mg6IPVAJ+U7i4zr9XGF/kb2RGsdehglGTV+vngqA==",
"dev": true
},
"babel-plugin-transform-minify-booleans": {
"version": "6.8.3",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.8.3.tgz",
"integrity": "sha512-bPbUhkeN2Nc0KH0/A19GwQGj8w+CvdJzyu8t59VoEDgsNMQ9Bopzi5DrVkrSsVjbYUaZpzq/DYLrH+wD5K2Tig==",
"dev": true
},
"babel-plugin-transform-regenerator": {
"version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz",
......@@ -823,6 +853,12 @@
"babel-types": "6.26.0"
}
},
"babel-plugin-transform-undefined-to-void": {
"version": "6.8.3",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.8.3.tgz",
"integrity": "sha512-goYwp8dMrzHD6x9GjZ2M85Mk2vxf1h85CnUgAjfftUnlJvzF4uj5MrbReHBTbjQ96C8CuRzvhYZ3tv8H3Sc1ZA==",
"dev": true
},
"babel-polyfill": {
"version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz",
......@@ -942,6 +978,20 @@
"babel-preset-es2017": "6.24.1"
}
},
"babel-preset-minify-es2015": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/babel-preset-minify-es2015/-/babel-preset-minify-es2015-0.0.3.tgz",
"integrity": "sha1-zOTRcw6PbPEeKN4nvNzq2YSZu3I=",
"dev": true,
"requires": {
"babel-plugin-groundskeeper-willie": "1.3.2",
"babel-plugin-transform-mangle": "0.1.7",
"babel-plugin-transform-member-expression-literals": "6.8.5",
"babel-plugin-transform-merge-sibling-variables": "6.8.6",
"babel-plugin-transform-minify-booleans": "6.8.3",
"babel-plugin-transform-undefined-to-void": "6.8.3"
}
},
"babel-register": {
"version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz",
......
......@@ -152,13 +152,15 @@
if (message instanceof Error) {
message = message.stack;
}
const prefix = style ? '%c' : '';
const logger = _.assign({
'debug': _.get(console, 'log') ? console.log.bind(console) : _.noop,
'error': _.get(console, 'log') ? console.log.bind(console) : _.noop,
'info': _.get(console, 'log') ? console.log.bind(console) : _.noop,
'warn': _.get(console, 'log') ? console.log.bind(console) : _.noop
const prefix = style ? '%c' : '',
has_log = _.get(console, 'log'),
logger = _.assign({
'debug': has_log && console.log.bind(console) || _.noop,
'error': has_log && console.log.bind(console) || _.noop,
'info': has_log && console.log.bind(console) || _.noop,
'warn': has_log && console.log.bind(console) || _.noop
}, console);
if (level === Strophe.LogLevel.ERROR) {
if (_converse.debug) {
logger.trace(`${prefix} ${moment().format()} ERROR: ${message}`, style);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment