annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
1 const path = require("path");
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
2 const webpack = require('webpack');
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
3
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
4 const resolveConfig = {
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
5 alias: {
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
6 'webpack-plugin-serve/client': './node_modules/webpack-plugin-serve/client.js',
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
7 },
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
8 extensions: ['.ts', '.js', '.json']
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
9 };
0
drewp@localhost
parents:
diff changeset
10
15
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
11 const moduleConfig = {
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
12 rules: [
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
13 {
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
14 test: /\.ts$/,
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
15 loader: 'ts-loader',
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
16 },
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
17 {
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
18 test: /\.css$/i,
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
19 use: ['file-loader']
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
20 },
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
21 {
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
22 test: /zzzzz\.js$/, use: {
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
23 loader: 'babel-loader',
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
24 options: {
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
25 }
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
26 }
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
27 }
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
28 ]
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
29 };
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
30 const pluginsConfig = [
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
31 ];
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
32 module.exports = {
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
33 name: "dev",
0
drewp@localhost
parents:
diff changeset
34 mode: "development",
drewp@localhost
parents:
diff changeset
35 entry: [
drewp@localhost
parents:
diff changeset
36 './src/streamed-graph.ts',
15
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
37 // './src/streamed-graph.css' // doesn't emit anything
0
drewp@localhost
parents:
diff changeset
38 ],
drewp@localhost
parents:
diff changeset
39 output: {
drewp@localhost
parents:
diff changeset
40 filename: 'streamed-graph.bundle.js',
drewp@localhost
parents:
diff changeset
41 path: path.resolve(__dirname, 'build')
drewp@localhost
parents:
diff changeset
42 },
15
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
43 resolve: resolveConfig,
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
44 devtool: 'source-map',
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
45 module: moduleConfig,
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
46 plugins: pluginsConfig,
0
drewp@localhost
parents:
diff changeset
47 devServer: {
drewp@localhost
parents:
diff changeset
48 port: 8082,
drewp@localhost
parents:
diff changeset
49 hot: false,
drewp@localhost
parents:
diff changeset
50 liveReload: true, // doesn't work
drewp@localhost
parents:
diff changeset
51 overlay: true,
15
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
52 watchContentBase: true
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
53 },
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
54 watch: true,
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
55 watchOptions: {
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
56 ignored: /node_modules/,
7ca4ff2088c3 managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents: 8
diff changeset
57 poll: 200
0
drewp@localhost
parents:
diff changeset
58 }
drewp@localhost
parents:
diff changeset
59 };
drewp@localhost
parents:
diff changeset
60