Last active
December 3, 2016 00:50
-
-
Save shawnbot/b366d21951d4cfdee8f1fbee568cefbd to your computer and use it in GitHub Desktop.
Browserify vs. Splittable tree-shaking
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 characters
Show hidden characters
{"presets": ["es2015", "stage-0"]} |
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 characters
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | |
'use strict'; | |
var _package = require('./package.json'); | |
console.log(_package.version); | |
},{"./package.json":2}],2:[function(require,module,exports){ | |
module.exports={ | |
"name": "minjs", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"time": "time npm run browserify; time npm run splittable", | |
"browserify": "browserify --debug -t babelify bundle.js | exorcist browserify.js.map > browserify.js", | |
"splittable": "splittable --write-to split bundle.js" | |
}, | |
"keywords": [], | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"babel-cli": "^6.18.0", | |
"babel-preset-es2015": "^6.18.0", | |
"babel-preset-stage-0": "^6.16.0", | |
"babelify": "^7.3.0", | |
"browserify": "^13.1.1", | |
"exorcist": "^0.4.0", | |
"splittable": "^3.0.1", | |
"uglify-js": "^2.7.5" | |
} | |
} | |
},{}]},{},[1]) | |
//# sourceMappingURL=browserify.js.map |
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 characters
{ | |
"version": 3, | |
"sources": [ | |
"node_modules/browser-pack/_prelude.js", | |
"bundle.js", | |
"package.json" | |
], | |
"names": [], | |
"mappings": "AAAA;;;ACAA;;AACA,QAAQ,GAAR;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA", | |
"file": "generated.js", | |
"sourceRoot": "", | |
"sourcesContent": [ | |
"(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})", | |
"import {version} from './package.json';\nconsole.log(version);\n", | |
"module.exports={\n \"name\": \"minjs\",\n \"version\": \"1.0.0\",\n \"description\": \"\",\n \"main\": \"index.js\",\n \"scripts\": {\n \"time\": \"time npm run browserify; time npm run splittable\",\n \"browserify\": \"browserify --debug -t babelify bundle.js | exorcist browserify.js.map > browserify.js\",\n \"splittable\": \"splittable --write-to split bundle.js\"\n },\n \"keywords\": [],\n \"author\": \"\",\n \"license\": \"ISC\",\n \"dependencies\": {\n \"babel-cli\": \"^6.18.0\",\n \"babel-preset-es2015\": \"^6.18.0\",\n \"babel-preset-stage-0\": \"^6.16.0\",\n \"babelify\": \"^7.3.0\",\n \"browserify\": \"^13.1.1\",\n \"exorcist\": \"^0.4.0\",\n \"splittable\": \"^3.0.1\",\n \"uglify-js\": \"^2.7.5\"\n }\n}\n" | |
] | |
} |
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 characters
import {version} from './package.json'; | |
console.log(version); |
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 characters
{ | |
"name": "minjs", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"time": "time npm run browserify; time npm run splittable", | |
"browserify": "browserify --debug -t babelify bundle.js | exorcist browserify.js.map > browserify.js", | |
"splittable": "splittable --write-to split bundle.js" | |
}, | |
"keywords": [], | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"babel-cli": "^6.18.0", | |
"babel-preset-es2015": "^6.18.0", | |
"babel-preset-stage-0": "^6.16.0", | |
"babelify": "^7.3.0", | |
"browserify": "^13.1.1", | |
"exorcist": "^0.4.0", | |
"splittable": "^3.0.1", | |
"uglify-js": "^2.7.5" | |
} | |
} |
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 characters
self.global=self;console.log("1.0.0"); | |
//# sourceMappingURL=splitbundle.js.map | |
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 characters
{ | |
"version":3, | |
"file":"/splitbundle.js", | |
"lineCount":1, | |
"mappings":"A,iBACAA,OAAAC,IAAA,CCCaC,ODDb;", | |
"sources":["/bundle.js","/package.json"], | |
"names":["console","log","module$package_json.version"] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment