Skip to content

Commit 5f25eaf

Browse files
authoredSep 6, 2019
Merge pull request #4169 from cjwainwright/distribute-minified-files-in-own-packages
Distribute minified files in own packages
2 parents 6eba3c5 + fd43bed commit 5f25eaf

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed
 

‎tasks/stats.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,10 @@ function getMainBundleInfo() {
142142
'',
143143
constants.partialBundlePaths.map(makeBundleHeaderInfo).join('\n'),
144144
'',
145-
'Starting in `v1.39.0`, each plotly.js partial bundle has a corresponding npm package with no dependencies.'
145+
'Starting in `v1.39.0`, each plotly.js partial bundle has a corresponding npm package with no dependencies.',
146+
'',
147+
'Starting in `v1.50.0`, the minified version of each partial bundle is also published to npm in a separate "dist min" package.',
148+
''
146149
];
147150
}
148151

@@ -209,6 +212,13 @@ function makeBundleInfo(pathObj) {
209212
'var Plotly = require(\'' + pkgName + '\');',
210213
'```',
211214
'',
215+
'#### dist min npm package (starting in `v1.50.0`)',
216+
'',
217+
'Install [`' + pkgName + '-min`](https://www.npmjs.com/package/' + pkgName + '-min) with',
218+
'```',
219+
'npm install ' + pkgName + '-min',
220+
'```',
221+
'',
212222
'#### Other plotly.js entry points',
213223
'',
214224
'| Flavor | Location |',

‎tasks/sync_packages.js

+20
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,26 @@ constants.partialBundlePaths
4141
}])
4242
.forEach(syncPartialBundlePkg);
4343

44+
// sync "minified partial bundle" packages
45+
constants.partialBundlePaths
46+
.map(function(d) {
47+
return {
48+
name: 'plotly.js-' + d.name + '-dist-min',
49+
index: d.index,
50+
main: 'plotly-' + d.name + '.min.js',
51+
dist: d.distMin,
52+
desc: 'Ready-to-use minified plotly.js ' + d.name + ' distributed bundle.',
53+
};
54+
})
55+
.concat([{
56+
name: 'plotly.js-dist-min',
57+
index: path.join(constants.pathToLib, 'index.js'),
58+
main: 'plotly.min.js',
59+
dist: constants.pathToPlotlyDistMin,
60+
desc: 'Ready-to-use minified plotly.js distributed bundle.',
61+
}])
62+
.forEach(syncPartialBundlePkg);
63+
4464
// sync "locales" package
4565
syncLocalesPkg({
4666
name: 'plotly.js-locales',

0 commit comments

Comments
 (0)