webpack.config.js 719 Bytes
const path = require("path");
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
  entry: ["./src/main.js"],
  output: {
    path: path.resolve(__dirname, "dist"),
    filename: "js/[name].js"
  },
  module: {
    rules: [
      {
        test: /\.jsx?$/,
        exclude: /node_modules/,
        use: {
          loader: "babel-loader"
        }
      },
      {
        test: /\.rt$/,
        exclude: /node_modules/,
        use: {
          loader: "react-templates-loader?modules=amd"
        }
      },
    ],
  },
  resolve: {
    extensions: ['.js', '.jsx', '.rt']
  },
  plugins: [
    new HtmlWebpackPlugin({
        template: 'src/index.html'
    })
  ],
  devtool: 'sourcemap',
}