How to build angular 2 app without cli
Asked Answered
I

2

9

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.

Inveracity answered 18/4, 2018 at 5:56 Comment(4)
what do you mean by withoutOstosis
I mean without Angular CLi. with angular cli command ng build --prod which do i want same thing without it.Inveracity
You don't want to use the CLI at all, or just for production?Loess
Thanks for replay, I do not want use in my projectInveracity
S
4

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

Shears answered 18/4, 2018 at 6:9 Comment(5)
Thanks Vikas, I think this can help.Inveracity
You're welcome!! Can you make it as correct answer if that's what you were looking for?Shears
Note that to use eject you have to use the version 1.7 of the CLIEcdysis
Sadly, this answer is no longer correct since the eject feature has been removed long ago. I do not know an easy way to do this yet, it seems the Angular team is solely focused on Angular CLI and Bazel right now.Vestibule
I have included a second link too where you can use webpack config, I will modify the answer soonShears
O
3

If you want to go without Angular CLI

  1. Do create all the required thing by yourself, and that is very difficult task
  2. you should go here : https://github.com/angular/quickstart , download quickstart project and start work

But I strongly suggest go with CLI as there it support end to end activity i.e. project start till deployment project

Ostosis answered 18/4, 2018 at 6:3 Comment(1)
For Some region I do not want to use angular 2 cli, I am doing the which you suggest but problem is I want to build it for production, in angular 2 official doc using cli to build it (ng build --prod)Inveracity

© 2022 - 2024 — McMap. All rights reserved.