What is this?
This contains the skeleton project for
- script to concat JS files for browser
Does not include
- Unit tests
npm install npm run build-webpack npm start-dev # or you can use npm start for production environment
Express is used to
- serve static files (from the
- serve generated artifacts (e.g. Webpack artifacts)
I only use Webpack for a very small fraction of its full capabilities.
Webpack is used to concatenate all the angular source files, and (for production) minify them.
It will also compile SASS into a single CSS file.
(Note that Webpack will also create a JS file so
you can use the CSS styles in your JS scripts.
extract-text-webpack-plugin would have
already extracted the CSS into its own file,
causing the JS file to be useless.)
It will also bundle 3rd party vendors into a single
vendor.js). It sounds simple, until I decided
I wanted to load Angular from a CDN. So I have to exclude
vendor.js. This is done by setting the
Webpack will generate a
app.js.map for the browser.
ExpressJS will detect if the NODE_ENV is development
and if so, it will make
app.js.map publicly accessible
for the browser.
Try a URL like
http://localhost:3000/app.js.map to see
if the map file is publicly available.
server/WebpackRouter.js for details.
It will be good to check
know what the entry points are.
I use ui-router for Angular routing
I use Angular 1.x
Angular and CommonJS
I separate my modules using CommonJS. There are no plans to use AMD at the moment. By using Webpack to concatenate all my application files, most of the problems that AMD tries to solve are avoided.
Angular 1.x and $resource
I use ngResource to make all the REST calls.