.es to its
name. For example, you rename file
extension indicates it uses ES2015 syntax and must therefore be transpiled by
Babel before deployment.
ES2015 advanced features, such as
generators, are available to
you if you import the
polyfillBabel class from the
found in Liferay DXP 7.0:
import polyfillBabel from 'polyfill-babel'
The Babel Polyfill emulates a complete ES6 environment. Use it at your own discretion, as it loads a large amount of code. You can inspect https://github.com/zloirock/core-js#core-js to see what’s polyfilled.
Once you’ve completed writing your module, you can expose it by creating a
package.json file that specifies your bundle’s name and version. Make sure to
create this in your module’s root folder. The js-logger
module, for example, specifies the following values in its