webpack/examples/code-splitting-harmony/example.js

14 lines
243 B
JavaScript
Raw Normal View History

2015-09-03 17:36:30 +08:00
import a from "a";
import("b").then(function(b) {
2015-09-03 17:36:30 +08:00
console.log("b loaded", b);
})
function loadC(name) {
return import("c/" + name);
2015-09-03 17:36:30 +08:00
}
Promise.all([loadC("1"), loadC("2")]).then(function(arr) {
console.log("c/1 and c/2 loaded", arr);
});