This is a small Angular Universal starter project. The project has the following features.
- An Angular 5 development environment setup using Vagrant
- Building Docker image and running the angular app in a Docker container
- Vagrant (with plugin vagrant-fsnotify)
- VirtualBox
- Git
- Visual Studio Code
- Set an environment variable - MYENV=DEV
- Clone the Git repository: https://github.com/saptarshibasu/angular-universal-setup
- Go to the directory: angular-universal-setup
- Run
vagrant up
- Run
vagrant fsnotify
Note: Wait for 2-3 minutes after vagrant up
exits for the URL http://localhost:4200 become available. Also, the fsnotify takes a few minutes before it starts listening to changes.
- Remove the environment variable - MYENV=DEV
- Clone the Git repository: https://github.com/saptarshibasu/angular-universal-setup
- Go to the directory: angular-universal-setup
- Run
vagrant up
Note: The app will be accessible at http://localhost:4000
vagrant halt
will shutdown the virtual machinevagrant destroy
will destroy the virtual machine
##Project Setup Notes The Angular Universal setup steps are detailed here: https://angular.io/guide/universal
However, I need to do a few things to get things working due to version incompatibility among various packages.
- Webpack 3 is not compatible with ts-loader versions higher than 3.5.0. At the time of developing this, the latest version of Angular CLI is 1.7.2 which uses Webpack 3.*. Hence, while setting up Angular Universal, install ts-config@3.5.0
webpack.ContextReplacementPlugin
plugin syntax used in the documentation doesn't seem to work with Webpack 3.* and hence I had to use the alternative syntax