Should I keep @angular/compiler in dependencies or devDependencies in package.json? Why do I need it in dependencies if my production code is already compiled?
A dependency is a library that a project needs to function effectively. DevDependencies are the packages a developer needs during development.
Packages required to build the webpack project are under dependencies, rather than devDependencies .
dependencies : Packages required by your application in production. devDependencies : Packages that are only needed for local development and testing.
Packages like eslint are always a devDependency … unless, of course, you're building a CLI whose job is running eslint, in which case you'd add it as a dependency!
2021 UPDATE:
The AOT compiler has improved significantly, and can be used for development.
package.json is organized into two groups of packages:
You should keep @angular/compiler in dependencies because as it mention in its official document as below
Angular's template compiler. It understands templates and can convert them to code that makes the application run and render. Typically you don’t interact with the compiler directly; rather, you use it indirectly via platform-browser-dynamic when JIT compiling in the browser. For more information, see the Ahead-of-time Compilation guide.
For more detail you can check its official document.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With