Angular-cli: Bundling into one file

Created on 7 Feb 2017  路  3Comments  路  Source: angular/angular-cli

After an ng build --prod, a directory listing of dist looks like this:

inline.bundle.js 
main.bundle.js
polyfills.bundle.js
styles.bundle.js 
vendor.bundle.js
index.html

I am creating a widget and would like a consumer to include only one file - widget.js. Is reverting to webpack the only option I have?

All 3 comments

You could create a custom script to concat the files after the ng build --prod maybe on a repo pipeline, cd/ci hook, or create a custom script in the package.json
"build": "ng build --prod && gulp concat"
Just make sure to keep the same order though.

inline -> styles -> scripts -> vendor -> main

Dupe of #3288.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings