Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build angular 2 app without cli

I am new in angular 2, I want to know how to build my angular 2 app without using CLI for production.

Thanks in Advance.

like image 463
Shiva Avatar asked Apr 18 '18 05:04

Shiva


People also ask

Can I use Angular without CLI?

We will start by setting up the module loader, then use npm to install Angular and its dependencies, as well as some tools and polyfills we will need, such as the TypeScript compiler. Finally, we will create a minimal application skeleton, and write the code for bootstrapping it.

Can we install Angular CLI without npm?

Installing Angular CLI on Windows First, you need to have Node and npm installed on your development machine. There are many ways to do that, such as: using NVM (Node Version Manager) for installing and working with multiple versions of node in your system. using the official package manager of your operating system.


1 Answers

If you have used CLI for your existing application You can migrate from Angular CLI to Webpack and tweak it accordingly for (local, development, production). Since Angular CLI v1.0 there’s the “eject” feature, that allows you to extract thewebpack config file and manipulate it as you wish.

Run ng eject so Angular CLI generates the webpack.config.js file.
Run npm install so the new dependencies generated by CLI are satisfied
Refer this Angular CLI to webpack
if you don't want to use CLI at all Refer This An Angular 2 Webpack setup for development and production and Webpack: An Introduction

like image 94
Vikas Avatar answered Sep 30 '22 11:09

Vikas