0

According to official docs about .angular-cli.json config file, only main, test, polyfills can be supported as webpack entry files.

How can I set a user-defined entry file, for example, "usr": "usr.ts" by defining .angular-cli.json or some other possible way?

1 Answer 1

2

The main, test, and polyfills "webpack entry files" are in the context of the Angular-CLI webpack configuration which is a 'state-of-the-art' webpack configuration. If you want to rename the entry files for your own webpack configuration, you should review the Angular-CLI official docs on 'ejecting'. A use-case of 'ng eject' is to make use of a custom user-defined webpack configuration by ejecting your application out of any Angular-CLI specific webpack configuration to decouple your app from the Angular-CLI. Once you eject you would rename the files specific to your own custom webpack configuration that is output as a result of running the command 'ng eject'. After ejecting your application from the Angular-CLI you can't utilize the Angular-CLI commands anymore; however, you could then run the corresponding 'ng serve' command by running 'npm start' to serve the app using your 'user-defined' modifications on the webpack configuration output as a result of 'ng eject'. After ejecting from the Angular-CLI you should see logged as output to the console, something to the effect:

  • "npm run build" to build.
  • "npm run test" to run unit tests.
  • "npm start" to serve the app using webpack-dev-server.
  • "npm run e2e" to run protractor.

Running the equivalent CLI commands will result in an error. You may need to run "npm install" again.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.