Mercurial > code > home > repos > streamed-graph
comparison webpack-dev.config.ts @ 18:4bf74032e2e8
merge
author | drewp@bigasterisk.com |
---|---|
date | Thu, 12 Dec 2019 22:57:14 -0800 |
parents | 7ca4ff2088c3 |
children |
comparison
equal
deleted
inserted
replaced
17:94629c39681c | 18:4bf74032e2e8 |
---|---|
1 import path from "path"; | 1 const path = require("path"); |
2 import webpack from 'webpack'; | 2 const webpack = require('webpack'); |
3 | 3 |
4 const config: webpack.Configuration = { | 4 const resolveConfig = { |
5 alias: { | |
6 'webpack-plugin-serve/client': './node_modules/webpack-plugin-serve/client.js', | |
7 }, | |
8 extensions: ['.ts', '.js', '.json'] | |
9 }; | |
10 | |
11 const moduleConfig = { | |
12 rules: [ | |
13 { | |
14 test: /\.ts$/, | |
15 loader: 'ts-loader', | |
16 }, | |
17 { | |
18 test: /\.css$/i, | |
19 use: ['file-loader'] | |
20 }, | |
21 { | |
22 test: /zzzzz\.js$/, use: { | |
23 loader: 'babel-loader', | |
24 options: { | |
25 } | |
26 } | |
27 } | |
28 ] | |
29 }; | |
30 const pluginsConfig = [ | |
31 ]; | |
32 module.exports = { | |
33 name: "dev", | |
5 mode: "development", | 34 mode: "development", |
6 entry: [ | 35 entry: [ |
7 './src/streamed-graph.ts', | 36 './src/streamed-graph.ts', |
8 './src/streamed-graph.css' // doesn't emit anything | 37 // './src/streamed-graph.css' // doesn't emit anything |
9 ], | 38 ], |
10 output: { | 39 output: { |
11 filename: 'streamed-graph.bundle.js', | 40 filename: 'streamed-graph.bundle.js', |
12 path: path.resolve(__dirname, 'build') | 41 path: path.resolve(__dirname, 'build') |
13 }, | 42 }, |
14 resolve: { | 43 resolve: resolveConfig, |
15 alias: { | 44 devtool: 'source-map', |
16 'webpack-plugin-serve/client': './node_modules/webpack-plugin-serve/client.js', | 45 module: moduleConfig, |
17 }, | 46 plugins: pluginsConfig, |
18 extensions: ['.ts', '.js', '.json'] | |
19 }, | |
20 module: { | |
21 rules: [ | |
22 { test: /\.ts$/, use: 'ts-loader', exclude: /node_modules/ }, | |
23 { test: /\.css$/i, use: ['file-loader'] }, | |
24 ] | |
25 }, | |
26 devServer: { | 47 devServer: { |
27 port: 8082, | 48 port: 8082, |
28 hot: false, | 49 hot: false, |
29 liveReload: true, // doesn't work | 50 liveReload: true, // doesn't work |
30 overlay: true, | 51 overlay: true, |
31 watchContentBase: true, | 52 watchContentBase: true |
53 }, | |
54 watch: true, | |
55 watchOptions: { | |
56 ignored: /node_modules/, | |
57 poll: 200 | |
32 } | 58 } |
33 }; | 59 }; |
34 | 60 |
35 export default config; |