-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathwebpack.vscode.config.js
More file actions
71 lines (64 loc) · 1.93 KB
/
webpack.vscode.config.js
File metadata and controls
71 lines (64 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
const { composePlugins, withNx } = require('@nx/webpack');
const path = require('path');
/**
* ABOUT
*
* Base webpack file for our apps that need webpack
*
* Some issue migrating where this is something that should be set for anything
* that builds using webpack.
*
* Setting this up for a shared webpack file that all of the other configs can use
*/
// Nx plugins for webpack.
module.exports = composePlugins(withNx(), (config) => {
/**@type WebpackConfig*/
const newConfig = {
...config,
externals: {
vscode: 'commonjs vscode', // ignored because it doesn't exist
expect: 'commonjs expect', // Don't bundle expect, we should be able to get this from node_modules. Importing was causing a error for e2e tests
},
// stats: 'none',
// devtool: 'none',
// plugins: [
// new webpack.SourceMapDevToolPlugin({
// exclude: [/vscode-languageserver/i],
// }),
// ],
// stats: {
// hash: true,
// timings: false,
// cached: false,
// cachedAssets: false,
// modules: false,
// warnings: false,
// errors: true,
// colors: true,
// chunks: true,
// assets: false,
// chunkOrigins: false,
// chunkModules: false,
// children: false,
// reasons: false,
// }
};
// Find the ForkTsCheckerWebpackPlugin instance
// const tsCheckerPlugin = newConfig.plugins.find(
// (p) => p.constructor.name === 'ForkTsCheckerWebpackPlugin'
// );
// if (tsCheckerPlugin) {
// Increase memory to 4GB (4096) or 8GB (8192)
// tsCheckerPlugin.options.typescript.memoryLimit = 8192;
// tsCheckerPlugin.options.typescript.mode = 'write-references';
// tsCheckerPlugin.options.async = false;
// }
if (!config.resolve) {
config.resolve = {};
}
if (!config.resolve.alias) {
config.resolve.alias = {};
}
config.resolve.alias.zod$ = path.resolve(__dirname, 'node_modules/zod/v3');
return newConfig;
});