2

I am looking to deploy a project angular (angular 6) to a host (OVH). I did not create my application with Angular CLI so I can't use "ng build "

I've been looking for several weeks What should I do ?

Thank you in advance for your answers.

3
  • 1
    how are you building and testing your app so far?? Commented Aug 14, 2018 at 14:25
  • with node (npm start) Commented Aug 15, 2018 at 7:46
  • well I mean which tools are you using ? webpack, gulp, grunt, /// ?? Commented Aug 15, 2018 at 9:25

4 Answers 4

2

Quick and dirty solution:

  • create a new empty project with ng new
  • delete all source files
  • copy your source files in the src/app/ folder
Sign up to request clarification or add additional context in comments.

2 Comments

Your solution works well for me but I have a error with RXJS. When I do "import {Observable} from ' rxjs/Observable '; " Angular doesn't seem to find an exported member: ' Observable ' yet the rxjs folder is present in the node-module folder
have you followed github.com/ReactiveX/rxjs/blob/master/docs_app/content/guide/v6/… ? Now you have to do ``` import { Observable } from 'rxjs'; ```
1

If you are using a build tool like webpack/gulp/grunt/etc you can write a script to transpile all the .ts files down to js and html/scss as well. Then you just serve your dist.

Comments

1

I think you need to read this, and than come up with a solution.

https://blog.angularindepth.com/setting-up-angular-from-scratch-1f518c65d8ab

Comments

-1

You can add angular cli to your npm, it is global not project specific

npm install -g @angular/cli

than simply write:

ng build —prod

Take the files inside /dist dir and simply put  them on a web server

Good luck

1 Comment

He said he cannot use ng build because his project is not managed with @angular/cli

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.