Skip to content

Commit

Permalink
add polyfill for IE (#8)
Browse files Browse the repository at this point in the history
1. use if comment to include scirpt only for IE
2. use html-webpack-plugin to inject file hash
  • Loading branch information
PinkyJie committed Dec 16, 2015
1 parent 7896561 commit b4fb8b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion source/app/index.jade
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
doctype html
//- variable `app` here is used by gulp
//- variable `app` here is used by build script
html(lang="en", ng-app= app, ng-strict-di)
head
//- This helps the ng-show/ng-hide animations start at the right place.
Expand All @@ -11,6 +11,10 @@ html(lang="en", ng-app= app, ng-strict-di)
meta(http-equiv="X-UA-Compatible", content="IE=edge, chrome=1")
meta(name="viewport", content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no")
base(href="/")
// babel polyfill for IE
<!--[if IE]>
<script src="ie-polyfill.{%=o.webpack.hash%}.js"></script>
<![endif]-->

body(ng-class="_class + '-page'")
.wrapper(ui-view)
3 changes: 2 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ module.exports = {
'angular-mocks',
'angular-loading-bar',
'oclazyload'
]
],
'ie-polyfill': 'babel-core/polyfill.js'
},
output: {
path: base + 'build',
Expand Down

0 comments on commit b4fb8b4

Please sign in to comment.