Mercurial > code > home > repos > streamed-graph
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 |
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 | 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 | 34 mode: "development", |
35 entry: [ | |
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 | 38 ], |
39 output: { | |
40 filename: 'streamed-graph.bundle.js', | |
41 path: path.resolve(__dirname, 'build') | |
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 | 47 devServer: { |
48 port: 8082, | |
49 hot: false, | |
50 liveReload: true, // doesn't work | |
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 | 58 } |
59 }; | |
60 |