Create a webpack template project which supports AngularJS 1.5, ES6 with Babel, RxJS, and service worker for offline experience. This project mainly consists of two controllers, one Angular directive, and the corresponding views. The compiled applicaiton can be dropped to an HTTP server and served at a predefined domain.
This project is inspired by the project at https://github.com/preboot/angular-webpack.git.
```git clone [email protected]:liyutech/webpack-angular-template```Run the following command at the root path of the cloned project:
npm install The versions of nodejs and npm used to develop and test this template:nodejs: v4.4.0
npm: 3.8.6
To run in the dev mode: npm startUse a browser to open the following url: https://localhost:8080. The user name and password for the login fields are Ada and Ada123, respectively.
To deploy the application, run the following command at the root of the project:
npm run build
This will compile the application. The compiled files will be output to the webpack-angular-template/ directory.After the compilation is complete, copy the entire webpack-angular-template/ directory to the document root of an HTTP server. Notice that since service workers can only be run under the https protoocol, the HTTP server should be configured to support https.
It is assumed the document root of the server is /www. To use a different document root, modify the default defined in webpack.config.prod.js. The deployed application can be accessed at https://localhost:8443/webpack-angular-template. The login user name and password are also Ada and Ada123, respectively.
Notice that if the browser does not support service workers, the application will fall back to appcache.MIT (http://www.opensource.org/licenses/mit-license.php)