Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3485c0e

Browse filesBrowse files
committed
add compress_attributes.js transform to "browserify" field
- so that it is enabled by default on browserify builds - mv it to `./tasks/` for better discoveribility - ignore it when bundling plotly-with-meta.js bundle - 🔪 other refs to compress_attributes.js
1 parent 74f9f39 commit 3485c0e
Copy full SHA for 3485c0e

File tree

Expand file treeCollapse file tree

5 files changed

+8
-6
lines changed
Filter options
Expand file treeCollapse file tree

5 files changed

+8
-6
lines changed

‎package.json

Copy file name to clipboardExpand all lines: package.json
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
},
5050
"browserify": {
5151
"transform": [
52-
"glslify"
52+
"glslify",
53+
"./tasks/compress_attributes.js"
5354
]
5455
},
5556
"dependencies": {

‎tasks/bundle.js

Copy file name to clipboardExpand all lines: tasks/bundle.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ _bundle(constants.pathToPlotlyGeoAssetsSrc, constants.pathToPlotlyGeoAssetsDist,
4141
// Browserify the plotly.js with meta
4242
_bundle(constants.pathToPlotlyIndex, constants.pathToPlotlyDistWithMeta, {
4343
standalone: 'Plotly',
44-
debug: DEV
44+
debug: DEV,
45+
noCompress: true
4546
});
4647

4748
// Browserify the plotly.js partial bundles
File renamed without changes.

‎tasks/util/browserify_wrapper.js

Copy file name to clipboardExpand all lines: tasks/util/browserify_wrapper.js
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ var browserify = require('browserify');
55
var UglifyJS = require('uglify-js');
66

77
var constants = require('./constants');
8-
var compressAttributes = require('./compress_attributes');
98
var patchMinified = require('./patch_minified');
109

1110
/** Convenience browserify wrapper
@@ -38,7 +37,10 @@ module.exports = function _bundle(pathToIndex, pathToBundle, opts) {
3837
var browserifyOpts = {};
3938
browserifyOpts.standalone = opts.standalone;
4039
browserifyOpts.debug = opts.debug;
41-
browserifyOpts.transform = outputMinified ? [compressAttributes] : [];
40+
41+
if(opts.noCompress) {
42+
browserifyOpts.ignoreTransform = './tasks/compress_attributes.js';
43+
}
4244

4345
var b = browserify(pathToIndex, browserifyOpts),
4446
bundleWriteStream = fs.createWriteStream(pathToBundle);

‎tasks/util/watchified_bundle.js

Copy file name to clipboardExpand all lines: tasks/util/watchified_bundle.js
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ var prettySize = require('prettysize');
66

77
var constants = require('./constants');
88
var common = require('./common');
9-
var compressAttributes = require('./compress_attributes');
109

1110
/**
1211
* Make a plotly.js browserify bundle function watched by watchify.
@@ -22,7 +21,6 @@ module.exports = function makeWatchifiedBundle(onFirstBundleCallback) {
2221
var b = browserify(constants.pathToPlotlyIndex, {
2322
debug: true,
2423
standalone: 'Plotly',
25-
transform: [compressAttributes],
2624
cache: {},
2725
packageCache: {},
2826
plugin: [watchify]

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.