disword
9/22/2017 - 8:33 AM

ts webpack

var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {

  entry: './src/index.ts',

  output: {
    path: __dirname + '/dist',
    filename: 'app.js',
  },

  resolve: {
    extensions: ['.ts', '.js']
  },

  module: {
    loaders: [
      { test: /\.ts$/, loader: 'ts-loader' }
    ]
  },
  plugins: [
    new webpack.optimize.UglifyJsPlugin({
      // compress: {
      //   warnings: false,
      //   drop_console: true,
      //   pure_funcs: ['console.log']
      // },
      sourceMap: false
    }),
    new HtmlWebpackPlugin({
      template: 'src/index.html',
      filename: 'index.html'
    })
  ]

}