node package manager
Loosely couple your services. Use Orgs to version and reuse your code. Create a free org »

amazing-angular

Amazing.com Angular

Dependencies

What you need to run this app:

  • node and npm (brew install node)
  • Ensure you're running the latest versions Node v6.x.x+ and NPM v3.x.x+

Once you have those, you should install these globals with npm install --global:

  • webpack (npm install --global webpack)
  • webpack-dev-server (npm install --global webpack-dev-server)
  • typings (npm install --global typings)
  • typescript (npm install --global typescript)

Install global npm packages

Install the global npm packages. This should be run using sudo or administrator mode.

sudo npm install -g typescript webpack-dev-server rimraf webpack

Install project npm packages

Install the project npm packages described in the package.json and verify that it works:

Attention Windows Developers: You must run all of these commands in administrator mode

npm install

Build process for development/test environments

Execute this command to run the build process.

npm run build

This will generate a /dist folder that should be the target folder of the web server

Build process for production environment

Execute this command to run the build process.

npm run build:prod

This will generate a /dist folder that should be the target folder of the web server

Run Server

The npm start command first compiles the application, then simultaneously re-compiles and runs the webpack. Both the compiler and the server watch for file changes.

Open http://localhost:3000 in your browser to be able to see the changes. (Only Dev/Test environments)

Shut it down manually with Ctrl-C.

Hot Module Replacement

To use the (experimental) Hot Modules Replacement that is part of Webpack, you need to:

npm run server:hmr

npm scripts

  • npm run clean - removes all the temporary and precompiled files (node_modules, dist, typings).