Max Koretskyi
Max Koretskyi

Reputation: 105497

What is @angular/core/bundles/core.umd.js

I'm trying to explore how angular decorators are declared. I've found a file @angular/core/src/util/decorators.ts where makeDecorator function is defined. I was thinking that I could debug this file using a browser and provided source maps. However, a browser doesn't load @angular/core/src/util/decorators.js file, it loads @angular/core/bundles/core.umd.js which seems to include files from @angular/core/src, including @angular/core/src/util/decorators.js file.

So what is @angular/core/bundles/core.umd.js? Is it a bundle of @angular/core/src files?

There is @angular/core/tsconfig-build.json file that seems to be build configuration file. It seems to have the same structure as tsconfig.json file and is probably used by typescript compiler.

Upvotes: 5

Views: 3492

Answers (1)

Rahul Singh
Rahul Singh

Reputation: 150

After reading some articles on internet, The best I have come up with is umd in core.umd.js stands for universal module definition. So, core.umd.js is nothing but umd version of angular's core.js module.

Now, you may ask what umd is? As the name suggest it's a universal pattern for writing modules in javascript. It is being done for developers to write code in single agreed-upon way.

For more clarification please read-

  1. http://davidbcalhoun.com/2014/what-is-amd-commonjs-and-umd/

  2. https://github.com/umdjs/umd

Upvotes: 3

Related Questions