ng2-webpack-config

Just a few steps to steps to get up and running with angular2 and webpack
- Copy all
js files from samples folder to your application root folder
cp -rf node_modules/ng2-webpack-config/samples/* .
cp -rf node_modules/ng2-webpack-config/samples/.ng2-config.js .
- Copy
ts and .d.ts files to your angular2 app root folder ('./src' for example)
cp -rf node_modules/ng2-webpack-config/samples/src/*.ts ./src
- Only 2 small steps left to get app and running:
- Open
.ng2-config.js and update some fields if needed
module.exports = {
title: pkg.description,
baseUrl: '/',
src: 'src',
dist: 'dist',
htmlIndexes: ['index.html'],
spec: './spec-bundle.js',
entry: {
polyfills: './src/polyfills.ts',
vendor: './src/vendor.ts',
main: './src/index.ts'
},
commonChunks: {
name: ['polyfills', 'vendor'].reverse()
},
alias: {},
copy: [
{from: 'src/favicon.ico', to: 'favicon.ico'}
]
};
- Open
spec-bundle.js and update PATH_TO_FILES const
Now how to run it
- Webpack dev build, run:
$ webpack
- Webpack prod build, run:
$ NODE_ENV=production webpack
- Karma tests, run:
$ karma start
- Protractor tests, run
$ protractor