Created
January 19, 2017 20:34
-
-
Save jouni-kantola/591b76824f4d4d3e4df4c17bb10ad064 to your computer and use it in GitHub Desktop.
webpack tree shaking to the test
This file contains 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
// index.js | |
import { foo } from './module-tree-shaking.js'; | |
foo(); | |
// module-tree-shaking.js | |
export const foo = function foo() { | |
bar(); | |
}; | |
export const bar = function bar() { | |
console.log('bar'); | |
}; | |
// result | |
webpackJsonp([1, 2], { | |
GO9H: function(n, e, t) { | |
"use strict"; | |
t.d(e, "a", function() { | |
return o | |
}); | |
var o = function() { | |
c() | |
}, | |
c = function() { | |
console.log("bar") | |
} | |
}, | |
lVK7: function(n, e, t) { | |
"use strict"; | |
Object.defineProperty(e, "__esModule", { | |
value: !0 | |
}); | |
var o = t("GO9H"); | |
t.i(o.a)() | |
} | |
}, ["lVK7"]); | |
//# sourceMappingURL=app.4d3f37edbaf954d8f825.prod.js.map |
This file contains 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
// index.js | |
import { foo } from './module-tree-shaking.js'; | |
foo(); | |
// module-tree-shaking.js | |
export const foo = function foo() { | |
console.log('foo'); | |
}; | |
export const bar = function bar() { | |
console.log('bar'); | |
}; | |
// result | |
webpackJsonp([1, 2], { | |
GO9H: function(e, n, o) { | |
"use strict"; | |
o.d(n, "a", function() { | |
return t | |
}); | |
var t = function() { | |
console.log("foo") | |
} | |
}, | |
lVK7: function(e, n, o) { | |
"use strict"; | |
Object.defineProperty(n, "__esModule", { | |
value: !0 | |
}); | |
var t = o("GO9H"); | |
o.i(t.a)() | |
} | |
}, ["lVK7"]); | |
//# sourceMappingURL=app.2ebeccafd391592cc613.prod.js.map |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment