-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Enable compress attributes browserify transform by default #1584
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
Changes from 2 commits
74f9f39
3485c0e
03be8ff
ce2a33a
7e7baaf
9af5948
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ var browserify = require('browserify'); | |
var UglifyJS = require('uglify-js'); | ||
|
||
var constants = require('./constants'); | ||
var compressAttributes = require('./compress_attributes'); | ||
var patchMinified = require('./patch_minified'); | ||
|
||
/** Convenience browserify wrapper | ||
|
@@ -38,7 +37,10 @@ module.exports = function _bundle(pathToIndex, pathToBundle, opts) { | |
var browserifyOpts = {}; | ||
browserifyOpts.standalone = opts.standalone; | ||
browserifyOpts.debug = opts.debug; | ||
browserifyOpts.transform = outputMinified ? [compressAttributes] : []; | ||
|
||
if(opts.noCompress) { | ||
browserifyOpts.ignoreTransform = './tasks/compress_attributes.js'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👏 This seems better by default, and |
||
} | ||
|
||
var b = browserify(pathToIndex, browserifyOpts), | ||
bundleWriteStream = fs.createWriteStream(pathToBundle); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ var prettySize = require('prettysize'); | |
|
||
var constants = require('./constants'); | ||
var common = require('./common'); | ||
var compressAttributes = require('./compress_attributes'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice that this just disappears. Opt-opt also scopes the transform better so it doesn't need to be applied globally 👍 |
||
|
||
/** | ||
* Make a plotly.js browserify bundle function watched by watchify. | ||
|
@@ -22,7 +21,6 @@ module.exports = function makeWatchifiedBundle(onFirstBundleCallback) { | |
var b = browserify(constants.pathToPlotlyIndex, { | ||
debug: true, | ||
standalone: 'Plotly', | ||
transform: [compressAttributes], | ||
cache: {}, | ||
packageCache: {}, | ||
plugin: [watchify] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏