var webpack = require('webpack');
var path = require("path");

var config = {
  entry: "./static/js/quay.module.ts",
  output: {
    path: path.resolve(__dirname, "static/build"),
    filename: "bundle.js"
  },
  resolve: {
    extensions: ["", ".ts", ".tsx", ".js", ".scss"],
    alias: {
      "sass": path.resolve('./static/css/directives/components/pages/')
    }
  },
  // Use window.angular to maintain compatibility with non-Webpack components
  externals: {
    "angular": "angular",
  },
  module: {
    loaders: [
      {
        test: /\.tsx?$/,
        loader: "ts-loader",
        exclude: /node_modules/
      },
      {
        test: /\.scss$/,
        loaders: ['style', 'css', 'sass'],
        exclude: /node_modules/
      },
      {
        test: /angular\.js$/,
        loader: 'expose?angular',
      }
    ]
  },
  devtool: "source-map",
};

module.exports = config;