Polyfills

It will add polyfills in your project, works only on html5 engine.

This is a task run by grunt.

Usage

In app.config.json, use polyfills keyword. Add your wanted polyfills in an array style declaration.

eg: If I want to have a polyfill for Object.entries(), I have to add the module es.object.entries:

{
  "profile": {
    "polyfills": [
      "es.object.entries"
    ]
  }
}

You can find the list of all polyfills modules in core-js documentation > Features

Note

If your project is in es5, the module es.object.assign for Object.assign() will be added automatically.

In your HTML template (index.html.tpl, remoteHttpIndex.html.tpl…), be sure to have the following lines.

<% if(globalOptions.hasPolyfills) { %>
    <script type="text/javascript" src="<%= globalOptions.libsDir %>/polyfills.js"></script>
<% } %>

Note

Be careful to add polyfills before all other .js files.