While I was going through Angular2 documentation, I came across below code in here.
src/polyfills.ts
import 'core-js/es6';
import 'core-js/es7/reflect';
require('zone.js/dist/zone');
if (process.env.ENV === 'production') {
// Production
} else {
// Development
Error['stackTraceLimit'] = Infinity;
require('zone.js/dist/long-stack-trace-zone');
}
In the above code we can see that there are both import
and require
statements.
"core-js" and "zone.js" are both node modules.
My question is; why is import
used for core-js and require
for "zone.js", is there any specific reason for this?