Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

Adding minified files to dist packages #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 11 additions & 1 deletion tasks/sync_packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,19 @@ constants.partialBundlePaths
name: 'plotly.js-' + d.name + '-dist',
index: d.index,
main: 'plotly-' + d.name + '.js',
minified: 'plotly-' + d.name + '.min.js',
dist: d.dist,
distMin: d.distMin,
desc: 'Ready-to-use plotly.js ' + d.name + ' distributed bundle.',
};
})
.concat([{
name: 'plotly.js-dist',
index: path.join(constants.pathToLib, 'index.js'),
main: 'plotly.js',
minified: 'plotly.min.js',
dist: constants.pathToPlotlyDist,
distMin: constants.pathToPlotlyDistMin,
desc: 'Ready-to-use plotly.js distributed bundle.',
}])
.forEach(syncPartialBundlePkg);
Expand Down Expand Up @@ -68,7 +72,8 @@ function syncPartialBundlePkg(d) {
files: [
'LICENSE',
'README.md',
d.main
d.main,
d.minified
]
};

Expand Down Expand Up @@ -121,6 +126,10 @@ function syncPartialBundlePkg(d) {
fs.copy(d.dist, path.join(pkgPath, d.main), cb);
}

function copyMinified(cb) {
fs.copy(d.distMin, path.join(pkgPath, d.minified), cb);
}

var copyLicense = _copyLicense(d, pkgPath);

var publishToNPM = _publishToNPM(d, pkgPath);
Expand All @@ -130,6 +139,7 @@ function syncPartialBundlePkg(d) {
writePackageJSON,
writeREADME,
copyMain,
copyMinified,
copyLicense,
publishToNPM
], function(err) {
Expand Down