Dean
Dean

Reputation: 1094

Angular 6 - How to add another library to vendor.js

Created a new angular project using 'ng new' command on Angular 6.1. After running 'ng build' command, 5 js files are produced: runtime.js, polyfills.js, styles.js, vendor.js, main.js.

How do I add another library into vendor.js, For example, bootstrap?

Upvotes: 0

Views: 2611

Answers (1)

Rajat Badjatya
Rajat Badjatya

Reputation: 828

vendor.js is a compiled file which angular generates for you, any libraries which you have imported to your project either they are angular libraries or 3rd parties libraries(bootsrap, lodash) compiled into a single vendor.js file.

So whenever you include the new 3rd party library to your project, angular doesn't create new vendor file, angular just compliled your new imported library and put into vendor bundle at the time of build.

To import bootstrap to your project refer to this answer: How to add bootstrap to an angular-cli project

Upvotes: 1

Related Questions