Bugzilla – Attachment 68233 Details for
Bug 15522
New interface for revamped circulation rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15522: Add production JS build mode
Bug-15522-Add-production-JS-build-mode.patch (text/plain), 4.71 KB, created by
Jesse Weaver
on 2017-10-17 23:00:07 UTC
(
hide
)
Description:
Bug 15522: Add production JS build mode
Filename:
MIME Type:
Creator:
Jesse Weaver
Created:
2017-10-17 23:00:07 UTC
Size:
4.71 KB
patch
obsolete
>From c146c2f4c347d29becc3806e452b2b6974a6492f Mon Sep 17 00:00:00 2001 >From: Jesse Weaver <pianohacker@gmail.com> >Date: Tue, 17 Oct 2017 16:42:22 -0600 >Subject: [PATCH] Bug 15522: Add production JS build mode > >To use, run yarn build (or make js-build) with PRODUCTION=1. >--- > gulpfile.js | 21 +++++++++++++-------- > package.json | 1 + > yarn.lock | 33 +++++++++++++++++++++++++++++++-- > 3 files changed, 45 insertions(+), 10 deletions(-) > >diff --git a/gulpfile.js b/gulpfile.js >index 3dce49592c..eaecbf7c90 100644 >--- a/gulpfile.js >+++ b/gulpfile.js >@@ -36,23 +36,28 @@ gulp.task( "watch", () => { > > let vendorBuilt = false; > >-gulp.task( "build", () => { >+function getBundler() { > let bundler = browserify( { >- debug: true >- } ) >- .transform( "babelify", { presets: [ "es2015", "react" ], plugins: [ "transform-class-properties" ] } ); >+ debug: !process.env.PRODUCTION, >+ } ); >+ >+ if ( process.env.DESCRIPTION ) { >+ bundler.transform( "uglifyify" ); >+ } > >+ return bundler; >+} >+ >+gulp.task( "build", () => { > if ( !vendorBuilt ) { >- browserify( { >- require: VENDOR_DEPENDENCIES, >- debug: true, >- } ) >+ getBundler().require( VENDOR_DEPENDENCIES ) > .bundle() > .on( "error", gutil.log ) > .pipe( source( "vendor.js" ) ) > .pipe( gulp.dest( BASE + "/built/" ) ); > } > >+ let bundler = getBundler().transform( "babelify", { presets: [ "es2015", "react" ], plugins: [ "transform-class-properties" ] } ); > > return gulp.src( BUILT_FILES ) > .pipe( tap( file => { >diff --git a/package.json b/package.json >index 2ee718fdd3..7e16d618b7 100644 >--- a/package.json >+++ b/package.json >@@ -18,6 +18,7 @@ > "promise-polyfill": "^6.0.2", > "react": "^16.0.0", > "react-dom": "^16.0.0", >+ "uglifyify": "^4.0.4", > "vinyl-source-stream": "^1.1.0", > "whatwg-fetch": "^2.0.3" > }, >diff --git a/yarn.lock b/yarn.lock >index 5c1b44f8ca..fb77630237 100644 >--- a/yarn.lock >+++ b/yarn.lock >@@ -788,6 +788,10 @@ combine-source-map@~0.7.1: > lodash.memoize "~3.0.3" > source-map "~0.5.3" > >+commander@~2.11.0: >+ version "2.11.0" >+ resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" >+ > concat-map@0.0.1: > version "0.0.1" > resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" >@@ -1025,6 +1029,10 @@ expand-tilde@^2.0.2: > dependencies: > homedir-polyfill "^1.0.1" > >+extend@^1.2.1: >+ version "1.3.0" >+ resolved "https://registry.yarnpkg.com/extend/-/extend-1.3.0.tgz#d1516fb0ff5624d2ebf9123ea1dac5a1994004f8" >+ > extend@^3.0.0: > version "3.0.1" > resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" >@@ -1768,7 +1776,7 @@ minimatch@^2.0.1: > dependencies: > brace-expansion "^1.0.0" > >-minimatch@^3.0.4: >+minimatch@^3.0.2, minimatch@^3.0.4: > version "3.0.4" > resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" > dependencies: >@@ -2280,6 +2288,10 @@ source-map@^0.5.6, source-map@~0.5.3: > version "0.5.6" > resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" > >+source-map@~0.5.1: >+ version "0.5.7" >+ resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" >+ > sparkles@^1.0.0: > version "1.0.0" > resolved "https://registry.yarnpkg.com/sparkles/-/sparkles-1.0.0.tgz#1acbbfb592436d10bbe8f785b7cc6f82815012c3" >@@ -2372,7 +2384,7 @@ through2@^2.0.0, through2@^2.0.3: > readable-stream "^2.1.5" > xtend "~4.0.1" > >-"through@>=2.2.7 <3": >+"through@>=2.2.7 <3", through@~2.3.4: > version "2.3.8" > resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" > >@@ -2416,6 +2428,23 @@ ua-parser-js@^0.7.9: > version "0.7.14" > resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.14.tgz#110d53fa4c3f326c121292bbeac904d2e03387ca" > >+uglify-es@^3.0.15: >+ version "3.1.3" >+ resolved "https://registry.yarnpkg.com/uglify-es/-/uglify-es-3.1.3.tgz#a21eeb149cb120a1f8302563689e19496550780b" >+ dependencies: >+ commander "~2.11.0" >+ source-map "~0.5.1" >+ >+uglifyify@^4.0.4: >+ version "4.0.4" >+ resolved "https://registry.yarnpkg.com/uglifyify/-/uglifyify-4.0.4.tgz#929f47acdbbf5e0626eae5002acc1e32349c7b3c" >+ dependencies: >+ convert-source-map "~1.1.0" >+ extend "^1.2.1" >+ minimatch "^3.0.2" >+ through "~2.3.4" >+ uglify-es "^3.0.15" >+ > umd@^3.0.0: > version "3.0.1" > resolved "https://registry.yarnpkg.com/umd/-/umd-3.0.1.tgz#8ae556e11011f63c2596708a8837259f01b3d60e" >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15522
:
68231
|
68232
|
68233
|
68234
|
68235
|
71048
|
71049
|
71050
|
71051
|
71052
|
72239
|
72242
|
91977
|
91978
|
91979
|
91980
|
91981
|
91982
|
91983
|
91984
|
94201
|
94202
|
94203
|
94204
|
94205
|
94206
|
94207
|
94208
|
99148
|
99149
|
99150
|
99151
|
99152
|
99153
|
99154
|
99155
|
99156
|
99157
|
99199
|
99200
|
99201
|
99202
|
99203
|
99204
|
99205
|
99206
|
99207
|
99208
|
99209
|
99210
|
99211
|
99213
|
99214
|
99215
|
101918
|
101919
|
101920
|
101921
|
101922
|
101923
|
101924
|
101925
|
101926
|
101927
|
101934
|
101935
|
101936
|
101937
|
101938
|
101939
|
101940
|
101941
|
101942
|
101943
|
101944
|
101945
|
101946
|
101947
|
106913
|
106914
|
106915
|
106916
|
106917
|
106918
|
106919
|
106920
|
106921
|
106922
|
106923
|
106924
|
106925
|
106926
|
112056
|
112057
|
112058
|
112059
|
112060
|
112061