var CompressionPlugin = require("compression-webpack-plugin");
var path = require("path");
var webpack = require("webpack");

module.exports = {
  // https://webpack.js.org/configuration/dev-server/
  devServer: {
    contentBase: "./public",
    compress: true,
    overlay: true,
    port: 3000
  },

  devtool: "cheap-module-source-map",

  entry: {
    widgets: ["babel-polyfill", "./src/widgets"]
  },
  
  "resolve": {
    "alias": {
      "react": "preact-compat",
      "react-dom": "preact-compat"
    }
  },

  module: {
    rules: [
      {
        include: path.resolve("./src"),
        test: /\.js$/,
        use: {
          loader: "babel-loader",
          options: {
            cacheDirectory: true
          }
        }
      }
    ]
  },

  output: {
    chunkFilename: "[id].[hash:5]-[chunkhash:7].js",
    devtoolModuleFilenameTemplate: "[absolute-resource-path]",
    filename: "[name].js",
    path: path.resolve("./build")
  },

  plugins: [
    new CompressionPlugin({
      test: /\.(html|js)$/
    })
  ]
};

@@ -404,30 +404,26 @@
  %7D,%0A
-  
 %0A  
-%22
 resolve
-%22
 : %7B%0A    
 %22ali
@@ -422,15 +422,13 @@
     
-%22
 alias
-%22
 : %7B%0A
@@ -437,15 +437,13 @@
     
-%22
 react
-%22
 : %22p

Fix whitespace