annotate service/wifi/webpack.config.js @ 662:540dd68af9f2

start ts config files, but this doesn't share the streamed-graph code properly yet Ignore-this: ef4e6fdf3369939b062caa5fdc2788e9
author drewp@bigasterisk.com
date Tue, 17 Dec 2019 23:16:53 -0800
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
662
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
1 const glob = require('glob');
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
2 const jest = require('jest');
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
3 const path = require("path");
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
4 const PnpWebpackPlugin = require('pnp-webpack-plugin');
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
5
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
6 const base = {
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
7 devtool: 'source-map',
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
8 module: {
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
9 rules: [
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
10 {
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
11 test: /\.ts$/,
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
12 loader: require.resolve('ts-loader'),
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
13 options: PnpWebpackPlugin.tsLoaderOptions({})
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
14 },
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
15 {
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
16 test: /\.css$/i,
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
17 use: ['file-loader']
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
18 },
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
19 ]
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
20 },
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
21 resolve: {
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
22 extensions: [".ts", ".js"],
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
23 plugins: [
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
24 PnpWebpackPlugin,
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
25 ],
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
26 alias: {
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
27 'streamed-graph': '/my/proj/streamed-graph'
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
28 },
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
29 modules: ['/tmp/sgpath2'],
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
30 },
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
31 resolveLoader: { plugins: [PnpWebpackPlugin.moduleLoader(module),], }
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
32 };
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
33
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
34 function outputToBundle(bundleName) {
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
35 return {
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
36 filename: bundleName,
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
37 path: path.resolve(__dirname, 'build'),
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
38 publicPath: '/build/'
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
39 };
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
40 }
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
41
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
42 module.exports = [
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
43 Object.assign({
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
44 name: "main",
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
45 entry: ['./src/wifi.ts'],
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
46 output: outputToBundle('wifi.bundle.js'),
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
47 devServer: {
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
48 port: 8082,
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
49 publicPath: '/build/',
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
50 contentBase: __dirname
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
51 }
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
52 }, base),
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
53 Object.assign({
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
54 name: "test",
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
55 entry: glob.sync('src/**/*.test.ts').map((p) => './' + p),
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
56 output: outputToBundle('test.bundle.js'),
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
57 plugins: [
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
58 {
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
59 apply: (compiler) => {
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
60 compiler.hooks.afterEmit.tap('AfterEmitPlugin', (compilation) => {
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
61 jest.run([
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
62 '--detectOpenHandles', // not just to debug; having this quiets a jest error
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
63 '--testRegex', 'test.bundle.js', 'build/test.bundle.js']);
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
64 });
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
65 }
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
66 }
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
67 ]
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
68 }, base)
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
69 ];
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents:
diff changeset
70