Skip to content
Snippets Groups Projects
webpack.common.js 899 B
Newer Older
Xiao Gui's avatar
Xiao Gui committed
const webpack = require('webpack')
const path = require('path')

module.exports = {
  module : {
    rules : [
      {
        test : /\.ts$/,
        loaders : ['ts-loader','angular2-template-loader?keepUrl=true'],
Xiao Gui's avatar
Xiao Gui committed
        exclude : /node_modules|[Ss]pec\.ts$/
Xiao Gui's avatar
Xiao Gui committed
      },
      {
Xiao Gui's avatar
Xiao Gui committed
        test : /third_party|.*?worker.*?\.js$/,
Xiao Gui's avatar
Xiao Gui committed
        use : {
          loader : 'file-loader',
          options: {
            name : '[name].[ext]'
          }
        }
      }
    ]
  },
  plugins : [
    new webpack.ContextReplacementPlugin(/@angular(\\|\/)core(\\|\/)/,path.join(__dirname,'src'))
Xiao Gui's avatar
Xiao Gui committed
  ],
  resolve : {
    extensions : [
      '.ts',
      '.js',
      '.json'
Xiao Gui's avatar
Xiao Gui committed
      "third_party" : path.resolve(__dirname,'third_party'),
      "src" : path.resolve(__dirname,'src'),
      "common": path.resolve(__dirname, 'common'),
      "spec": path.resolve(__dirname, 'spec')
Xiao Gui's avatar
Xiao Gui committed
  },
}