Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is bundled into vendor.bundle.js?

The angular-cli is producing vendor.bundle.js when executing a build.

What are the rules of what is going to be considered packed under vendor.bundle.js?

like image 387
Gambo Avatar asked May 02 '17 13:05

Gambo


2 Answers

I think any modules imported into the app.module.ts file will show up in the vendor bundle.

Example app.module.ts:

@NgModule({
  imports: [
    BrowserModule,
    CommonModule,
    FormsModule,
    RouterModule,
  ],
...
like image 55
Kevin LeStarge Avatar answered Oct 21 '22 09:10

Kevin LeStarge


vendors.bundle.js bundles every code imported by your app module: this includes local imports like components and services, but also third-party libs like lodash. It basically contains everything, so it's more interesting to see what's not in this file, mainly:

  • inline.bundle.js: webpack loader
  • scripts.build.js: all the scripts declared in angular-cli's scripts entry
  • polyfills.bundle.js: polyfills declared in polyfills.bundle.js

More details here

like image 20
Nino Filiu Avatar answered Oct 21 '22 08:10

Nino Filiu