From 9b77ee39ea49e2ae20734bccbd502fc7cb69b0fb Mon Sep 17 00:00:00 2001 From: Chris Wainwright Date: Fri, 26 Jul 2019 08:56:43 +0100 Subject: [PATCH 1/3] Publishing minified files to own dist packages --- tasks/sync_packages.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tasks/sync_packages.js b/tasks/sync_packages.js index ab19d59e3de..ff13cc4694f 100644 --- a/tasks/sync_packages.js +++ b/tasks/sync_packages.js @@ -41,6 +41,26 @@ constants.partialBundlePaths }]) .forEach(syncPartialBundlePkg); +// sync "minified partial bundle" packages +constants.partialBundlePaths + .map(function(d) { + return { + name: 'plotly.js-' + d.name + '-dist-min', + index: d.index, + main: 'plotly-' + d.name + '.min.js', + dist: d.distMin, + desc: 'Ready-to-use minified plotly.js ' + d.name + ' distributed bundle.', + }; + }) + .concat([{ + name: 'plotly.js-dist-min', + index: path.join(constants.pathToLib, 'index.js'), + main: 'plotly.min.js', + dist: constants.pathToPlotlyDistMin, + desc: 'Ready-to-use minified plotly.js distributed bundle.', + }]) + .forEach(syncPartialBundlePkg); + // sync "locales" package syncLocalesPkg({ name: 'plotly.js-locales', From c5797ddbea4d5f0d3b60b3732bfc56dd8134c226 Mon Sep 17 00:00:00 2001 From: Chris Wainwright Date: Fri, 6 Sep 2019 16:09:00 +0100 Subject: [PATCH 2/3] Adding documentation for dist min npm packages --- tasks/stats.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tasks/stats.js b/tasks/stats.js index 9d676e0aadb..1a56f6f6204 100644 --- a/tasks/stats.js +++ b/tasks/stats.js @@ -142,7 +142,10 @@ function getMainBundleInfo() { '', constants.partialBundlePaths.map(makeBundleHeaderInfo).join('\n'), '', - 'Starting in `v1.39.0`, each plotly.js partial bundle has a corresponding npm package with no dependencies.' + 'Starting in `v1.39.0`, each plotly.js partial bundle has a corresponding npm package with no dependencies.', + '', + 'Starting in `v1.50.0`, the minified version of each partial bundle is also published to npm in a separate "dist min" package.', + '' ]; } @@ -209,6 +212,13 @@ function makeBundleInfo(pathObj) { 'var Plotly = require(\'' + pkgName + '\');', '```', '', + '#### dist min npm package (starting in `v1.50.0`)', + '', + 'Install [`' + pkgName + '-min`](https://www.npmjs.com/package/' + pkgName + '-min) with', + '```', + 'npm install ' + pkgName + '-min', + '```', + '', '#### Other plotly.js entry points', '', '| Flavor | Location |', From fd43bed1d2dd1aaf0cf15ffeba912f6abf2113c1 Mon Sep 17 00:00:00 2001 From: Chris Wainwright Date: Fri, 6 Sep 2019 17:48:11 +0100 Subject: [PATCH 3/3] Removing trailing whitespace --- tasks/stats.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/stats.js b/tasks/stats.js index 1a56f6f6204..a0a58191483 100644 --- a/tasks/stats.js +++ b/tasks/stats.js @@ -217,7 +217,7 @@ function makeBundleInfo(pathObj) { 'Install [`' + pkgName + '-min`](https://www.npmjs.com/package/' + pkgName + '-min) with', '```', 'npm install ' + pkgName + '-min', - '```', + '```', '', '#### Other plotly.js entry points', '',