17

The current versions of AngularJS 2 references always npm based configurations.

  1. Is it possible to manage a project of AngularJS 2 without npm?
  2. Is it possible to use AngularJS 2 in production statically without npm/Node.js

I already found answers for examples using the beta versions of AngularJS 2 usiing links like https://code.angularjs.org/2.0.0-beta.17/angular2-all.umd.min.js. But for the current versions (like 2.1.1) there is no support left. Every examples and documentations point to npm (like https://angular.io/guide/quickstart).

2
  • Any reason for this? Commented Oct 27, 2016 at 14:47
  • 6
    @RobinDijkhof I want to use it in a Java project and also served by the Java application itself. Commented Oct 27, 2016 at 15:21

2 Answers 2

3

I found after a long search this github Repository with a working example for my question 2.: https://github.com/mgechev/angular2-simple-build

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

Comments

1

You need the node_modules folder in your project, which you get from npm or you could find online somewhere. I have ran projects without npm a few times, rather than using npm and the npm start command you can just run your code with whatever editor you are usings start commands.

2 Comments

This I also figured out but if you want to develop AngularJS2 together with TypeScript (with I also prefer) the node_modules folder contains a lot of other stuff that is not required in the production environment. This could be suitable if there is a command to only put the production java script stuff in a separate folder etc.
That is why you use angular cli or npm becase when you transfer your project into production it strips all of the un-used modules from your project and only deploys what is the bare minimum.

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.