Created
January 30, 2016 15:36
-
-
Save somebody32/293e80796c87331ccf90 to your computer and use it in GitHub Desktop.
Initial code splitting
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
import Backbone from 'backbone'; | |
import $ from 'jquery'; | |
import Router from './router'; | |
- import AboutApp from './apps/about/'; | |
- import HeavyApp from './apps/heavy/'; | |
$(() => { | |
new Router(); | |
- AboutApp(); | |
- HeavyApp(); | |
+ require.ensure([], require => { | |
+ const AboutApp = require('./apps/about/').default; | |
+ AboutApp(); | |
+ }); | |
+ require.ensure([], require => { | |
+ const HeavyApp = require('./apps/heavy/').default; | |
+ HeavyApp(); | |
+ }); | |
Backbone.history.start(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment