diff webpack-dev.config.ts @ 15:7ca4ff2088c3

managed to use a newer ts or something, so this includes a bunch of type fixes too
author drewp@bigasterisk.com
date Sun, 08 Dec 2019 23:32:12 -0800
parents 6fefd287aff9
children
line wrap: on
line diff
--- a/webpack-dev.config.ts	Fri Dec 06 20:34:01 2019 -0800
+++ b/webpack-dev.config.ts	Sun Dec 08 23:32:12 2019 -0800
@@ -1,35 +1,60 @@
-import path from "path";
-import webpack from 'webpack';
+const path = require("path");
+const webpack = require('webpack');
+
+const resolveConfig = {
+    alias: {
+        'webpack-plugin-serve/client': './node_modules/webpack-plugin-serve/client.js',
+    },
+    extensions: ['.ts', '.js', '.json']
+};
 
-const config: webpack.Configuration = {
+const moduleConfig = {
+    rules: [
+        {
+            test: /\.ts$/,
+            loader: 'ts-loader',
+        },
+        {
+            test: /\.css$/i,
+            use: ['file-loader']
+        },
+        {
+            test: /zzzzz\.js$/, use: {
+                loader: 'babel-loader',
+                options: {
+                }
+            }
+        }
+    ]
+};
+const pluginsConfig = [
+];
+module.exports = {
+    name: "dev",
     mode: "development",
     entry: [
         './src/streamed-graph.ts',
-        './src/streamed-graph.css'   // doesn't emit anything
+        // './src/streamed-graph.css'   // doesn't emit anything
     ],
     output: {
         filename: 'streamed-graph.bundle.js',
         path: path.resolve(__dirname, 'build')
     },
-    resolve: {
-        alias: {
-            'webpack-plugin-serve/client': './node_modules/webpack-plugin-serve/client.js',
-        },
-        extensions: ['.ts', '.js', '.json']
-    },
-    module: {
-        rules: [
-            { test: /\.ts$/, use: 'ts-loader', exclude: /node_modules/ },
-            { test: /\.css$/i, use: ['file-loader'] },
-        ]
-    },
+    resolve: resolveConfig,
+    devtool: 'source-map',
+    module: moduleConfig,
+    plugins: pluginsConfig,
     devServer: {
         port: 8082,
         hot: false,
         liveReload: true, // doesn't work
         overlay: true,
-        watchContentBase: true,
+        watchContentBase: true
+    },
+    watch: true,
+    watchOptions: {
+        ignored: /node_modules/,
+        poll: 200
     }
 };
 
-export default config;
\ No newline at end of file