PatrickJS / NG6-starter

:ng: An AngularJS Starter repo for AngularJS + ES6 + Webpack
https://angularclass.github.io/NG6-starter
Apache License 2.0
1.91k stars 1.35k forks source link

transform-runtime vs babel-polyfill #184

Open jsvg opened 7 years ago

jsvg commented 7 years ago

I believe these two configurations of babel are redundant.

babel-polyfill provides globals for es6 features, while the runtime transform method polyfills without using global methods. The latter method is usually preferable.

Would suggest modifying package.json to remove babel-polyfill. Also, babel docs recommend babel-runtime be included as a dependency (not devDep). Then babel-polyfill can be removed from the gulp file's paths.entry array.

This change appears to reduce build size by a small amount.

Can PR this if desired.

JabbyPanda commented 7 years ago

Actually, babel docs recommend to include babel-runtime as development dependency (devDep)

http://babeljs.io/docs/plugins/transform-runtime/#installation

soda-x commented 7 years ago

@JabbyPanda babel-runtime should be included as a dependency (not devDep) and babel-plugin-transform-runtime should be included as a dev-dependency.