Skip to content

Fix UMD in plotly.js dist files #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 20, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/assets/geo_assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@

var saneTopojson = require('sane-topojson');

// export the version found in the package.json
exports.version = require('../../package.json').version;

exports.topojson = saneTopojson;
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

var Plotly = require('./plotly');

// export the version found in the package.json
exports.version = require('../package.json').version;

// plot api
exports.plot = Plotly.plot;
exports.newPlot = Plotly.newPlot;
Expand Down
23 changes: 4 additions & 19 deletions tasks/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ var browserify = require('browserify');
var UglifyJS = require('uglify-js');

var compressAttributes = require('./util/compress_attributes');
var appendVersion = require('./util/append_version');
var constants = require('./util/constants');

/*
Expand Down Expand Up @@ -48,19 +47,11 @@ browserify(constants.pathToPlotlySrc, {
if(!DEV) {
fs.writeFile(
constants.pathToPlotlyDistMin,
UglifyJS.minify(buf.toString(), constants.uglifyOptions).code,
function() {
appendVersion(
constants.pathToPlotlyDistMin, {object: 'Plotly'}
);
}
UglifyJS.minify(buf.toString(), constants.uglifyOptions).code
);
}
})
.pipe(fs.createWriteStream(constants.pathToPlotlyDist))
.on('finish', function() {
appendVersion(constants.pathToPlotlyDist, {object: 'Plotly', DEV: DEV});
});
.pipe(fs.createWriteStream(constants.pathToPlotlyDist));


// Browserify the geo assets
Expand All @@ -70,10 +61,7 @@ browserify(constants.pathToPlotlyGeoAssetsSrc, {
.bundle(function(err) {
if(err) throw err;
})
.pipe(fs.createWriteStream(constants.pathToPlotlyGeoAssetsDist))
.on('finish', function() {
appendVersion(constants.pathToPlotlyGeoAssetsDist, {object: 'PlotlyGeoAssets'});
});
.pipe(fs.createWriteStream(constants.pathToPlotlyGeoAssetsDist));


// Browserify the plotly.js with meta
Expand All @@ -84,7 +72,4 @@ browserify(constants.pathToPlotlySrc, {
.bundle(function(err) {
if(err) throw err;
})
.pipe(fs.createWriteStream(constants.pathToPlotlyDistWithMeta))
.on('finish', function() {
appendVersion(constants.pathToPlotlyDistWithMeta, {object: 'Plotly', DEV: DEV});
});
.pipe(fs.createWriteStream(constants.pathToPlotlyDistWithMeta));
11 changes: 2 additions & 9 deletions tasks/cibundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ var fs = require('fs');
var browserify = require('browserify');

var compressAttributes = require('./util/compress_attributes');
var appendVersion = require('./util/append_version');
var constants = require('./util/constants');

/*
Expand All @@ -24,10 +23,7 @@ browserify(constants.pathToPlotlySrc, {
.bundle(function(err) {
if(err) throw err;
})
.pipe(fs.createWriteStream(constants.pathToPlotlyBuild))
.on('finish', function() {
appendVersion(constants.pathToPlotlyBuild, {object: 'Plotly'});
});
.pipe(fs.createWriteStream(constants.pathToPlotlyBuild));


// Browserify the geo assets
Expand All @@ -37,7 +33,4 @@ browserify(constants.pathToPlotlyGeoAssetsSrc, {
.bundle(function(err) {
if(err) throw err;
})
.pipe(fs.createWriteStream(constants.pathToPlotlyGeoAssetsDist))
.on('finish', function() {
appendVersion(constants.pathToPlotlyGeoAssetsDist, {object: 'PlotlyGeoAssets'});
});
.pipe(fs.createWriteStream(constants.pathToPlotlyGeoAssetsDist));
24 changes: 0 additions & 24 deletions tasks/util/append_version.js

This file was deleted.

4 changes: 0 additions & 4 deletions tasks/util/make_watchified_bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ var browserify = require('browserify');
var watchify = require('watchify');

var compressAttributes = require('./compress_attributes');
var appendVersion = require('./append_version');
var formatBundleMsg = require('./format_bundle_msg');
var constants = require('./constants');

Expand Down Expand Up @@ -53,9 +52,6 @@ module.exports = function makeWatchifiedBundle(onFirstBundleCallback) {
.pipe(
fs.createWriteStream(constants.pathToPlotlyBuild)
)
.on('finish', function() {
appendVersion(constants.pathToPlotlyBuild, {object: 'Plotly', DEV: true});
});
}

return bundle;
Expand Down