🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

ng2-webpack-config

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng2-webpack-config

Generic webpack config for Angular2 applications by @AngularClass

latest
Source
npmnpm
Version
0.0.5
Version published
Maintainers
1
Created
Source

ng2-webpack-config npm version npm downloads

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 = {
  // metadata
  title: pkg.description,
  baseUrl: '/',
  // angular2 root folder name
  src: 'src',
  // dist folder name
  dist: 'dist',
  // entry html file
  htmlIndexes: ['index.html'],
  // karma bundle src
  spec: './spec-bundle.js',
  // webpack entry
  entry: {
    polyfills: './src/polyfills.ts',
    vendor: './src/vendor.ts',
    main: './src/index.ts'
  },
  // in most cases you don't need to change this line
  commonChunks: {
    name: ['polyfills', 'vendor'].reverse()
  },
  // webpack alias (just in case)
  alias: {},
  // copy any additional files you need
  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

Keywords

angular2

FAQs

Package last updated on 15 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts