Skip to content

Commit

Permalink
Refactor entry point to use bundle-loader.
Browse files Browse the repository at this point in the history
  • Loading branch information
dtinth committed Dec 21, 2014
1 parent 202fa94 commit f294817
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ The directory structure:
npm start
```

- To run the application, go to `http://localhost:8080/`.
- To run unit tests, go to `http://localhost:8080/?mode=test`.


### Building

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"6to5": "^1.15.0",
"6to5-loader": "^0.2.4",
"autoprefixer-loader": "^1.0.0",
"bundle-loader": "^0.5.2",
"css-loader": "^0.9.0",
"glob": "^4.3.2",
"istanbul": "^0.3.5",
Expand Down
4 changes: 4 additions & 0 deletions www/src/boot/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ boot.querySelector('.js-progress-bar').classList.add('is-indeterminate')

document.body.appendChild(boot)

export function disappear() {
boot.style.display = 'none'
}

12 changes: 9 additions & 3 deletions www/src/boot/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@
// we minimize the amount of dependencies.
//

import './boot'
import * as boot from './boot'

function load(loader) {
loader(function(mdl) {
boot.disappear()
})
}

if (location.search.indexOf('mode=test') > -1) {
require.ensure(['../test'], (require) => require('../test'))
load(require('bundle?lazy!../test'))
} else {
require.ensure(['../app'], (require) => require('../app'))
load(require('bundle?lazy!../app'))
}

0 comments on commit f294817

Please sign in to comment.