Guest User

Untitled

a guest
Feb 22nd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. const path = require('path');
  2. const webpack = require('webpack');
  3. const helpers = require('./helpers');
  4. const HtmlWebpackPlugin = require('html-webpack-plugin');
  5. const ENV = process.env.NODE_ENV = process.env.ENV = 'production';
  6. module.exports = {
  7. entry: {
  8. polyfills: './app/polyfills.ts',
  9. vendor: './app/vendor.ts',
  10. app: './app/boot.ts'
  11. },
  12. output: {
  13. path: helpers.root('dist/non-aot'),
  14. publicPath: '/',
  15. filename: '[name].bundle.js',
  16. chunkFilename: '[id].chunk.js'
  17. },
  18. resolve: {
  19. extensions: ['.ts', '.js']
  20. },
  21. module: {
  22. loaders: [
  23. {
  24. test: /\.ts$/,
  25. loaders: ['awesome-typescript-loader', 'angular2-template-loader']
  26. },
  27. {
  28. test: /\.html$/,
  29. loader: 'html-loader'
  30. }
  31. ]
  32. },
  33. plugins: [
  34. new webpack.optimize.CommonsChunkPlugin({
  35. name: ['app', 'vendor', 'polyfills']
  36. }),
  37. new HtmlWebpackPlugin({
  38. template: 'config/index.html'
  39. }),
  40. new webpack.DefinePlugin({
  41. 'process.env': {
  42. 'ENV': JSON.stringify(ENV)
  43. }
  44. })
  45. ]
  46. };
Add Comment
Please, Sign In to add comment