Last active
August 9, 2019 13:21
-
-
Save mattdesl/57825db09d5193916cb3 to your computer and use it in GitHub Desktop.
Revisions
-
mattdesl revised this gist
Jan 7, 2016 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,6 +13,7 @@ if (process.env.NODE_ENV === 'development') { // fast dev server require('budo')(entry, { serve: 'bundle.js', stream: process.stdout, // log requests in terminal live: true, // enable LiveReload browserify: bundleOpts }); -
mattdesl revised this gist
Jan 7, 2016 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,7 +19,9 @@ if (process.env.NODE_ENV === 'development') { } else { // optimized production bundle require('browserify')(entry, bundleOpts) .transform('unreachable-branch-transform', { // dead code elimination global: true // so that it runs on dependencies, e.g. react, react-dom }) .plugin('bundle-collapser/plugin') // smaller bundle size .bundle() .pipe(process.stdout); -
mattdesl revised this gist
Jan 7, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,7 +19,7 @@ if (process.env.NODE_ENV === 'development') { } else { // optimized production bundle require('browserify')(entry, bundleOpts) .transform('unreachable-branch-transform', { global: true }) // dead code elimination .plugin('bundle-collapser/plugin') // smaller bundle size .bundle() .pipe(process.stdout); -
mattdesl revised this gist
Jan 7, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ Small script for development + builds with browserify. Uses `loose-envify` for faster inlining and `cross-env` to handle windows/unix shells. Dev features: - fast rebuilds w/ watchify, LiveReload, syntax errors in DOM, etc. Build features: - uglify, simple dead code elimination, optimized bundle. -
mattdesl renamed this gist
Jan 7, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
mattdesl revised this gist
Jan 7, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ ... "scripts": { "start": "cross-env NODE_ENV=development node build.js", "build": "cross-env NODE_ENV=production node build.js | uglifyjs -cm > app/bundle.js" } ... -
mattdesl revised this gist
Jan 7, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ var entry = 'index.js'; // Some options shared in dev + prod var bundleOpts = { debug: true, // inline source maps transform: [ 'babelify', 'loose-envify' @@ -13,7 +13,7 @@ if (process.env.NODE_ENV === 'development') { // fast dev server require('budo')(entry, { serve: 'bundle.js', live: true, // enable LiveReload browserify: bundleOpts }); } else { -
mattdesl revised this gist
Jan 7, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ Small script for development + builds with browserify. Uses `loose-envify` for faster inlining and `cross-env` to handle windows/unix shells. -
mattdesl revised this gist
Jan 7, 2016 . 1 changed file with 6 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,8 +2,12 @@ Script for development + build with browserify. Uses `loose-envify` for faster inlining and `cross-env` to handle windows/unix shells. Dev features: - fast rebuidls w/ watchify, LiveReload, syntax errors in DOM, etc. Build features: - uglify, simple dead code elimination, optimized bundle. ```sh npm install --save-dev cross-env browserify budo babelify loose-envify bundle-collapser uglify-js unreachable-branch-transform -
mattdesl created this gist
Jan 7, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ Script for development + build with browserify. Uses `loose-envify` for faster inlining and `cross-env` to handle windows/unix shells. Dev features: fast rebuidls w/ watchify, LiveReload, syntax errors in DOM, etc. Build features: uglify, simple dead code elimination, optimized bundle. ```sh npm install --save-dev cross-env browserify budo babelify loose-envify bundle-collapser uglify-js unreachable-branch-transform ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ var entry = 'index.js'; // Some options shared in dev + prod var bundleOpts = { debug: true, transform: [ 'babelify', 'loose-envify' ] }; if (process.env.NODE_ENV === 'development') { // fast dev server require('budo')(entry, { serve: 'bundle.js', live: true, browserify: bundleOpts }); } else { // optimized production bundle require('browserify')(entry, bundleOpts) .transform('unreachable-branch-transform') // dead code elimination .plugin('bundle-collapser/plugin') // smaller bundle size .bundle() .pipe(process.stdout); } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ ... "scripts": { "start": "cross-env NODE_ENV=development node tools/build.js", "build": "cross-env NODE_ENV=production node tools/build.js | uglifyjs -cm > app/bundle.js" } ...