-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathwebpack.development.js
65 lines (63 loc) · 1.91 KB
/
webpack.development.js
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
/** @format */
/* eslint @typescript-eslint/no-var-requires:0 */
// const path = require('path');
const { HotModuleReplacementPlugin } = require('webpack');
const nodeExternals = require('webpack-node-externals');
module.exports = (original) => ({
watch: true,
target: 'node',
externals: [nodeExternals({ allowlist: ['webpack/hot/poll?100'] })],
devServer: {
inline: true,
hot: true,
},
optimization: {
minimize: false,
},
plugins: [
...(original?.plugins ?? []),
// new webpack.IgnorePlugin({
// /**
// * There is a small problem with Nest's idea of lazy require() calls,
// * Webpack tries to load these lazy imports that you may not be using,
// * so we must explicitly handle the issue.
// * Refer to: https://github.com/nestjs/nest/issues/1706
// */
// checkResource(resource) {
// const lazyImports = [
// // '@nestjs/microservices',
// // '@nestjs/platform-express',
// // 'class-validator',
// // 'class-transformer',
// // 'google-libphonenumber',
// // '@nestjs/graphql',
// // 'cache-manager',
// // 'typeorm',
// // 'graphql',
// // 'jodit',
// // 'jodit-react',
// ];
// if (!lazyImports.includes(resource)) {
// return false;
// }
// try {
// require.resolve(resource);
// } catch (err) {
// return true;
// }
// return false;
// },
// }),
new HotModuleReplacementPlugin(),
],
stats: {
// This is optional, but it hides noisey warnings
warningsFilter: [
// 'node_modules/express/lib/view.js',
// 'node_modules/@nestjs/common/utils/load-package.util.js',
// 'node_modules/@nestjs/core/helpers/load-adapter.js',
// 'node_modules/optional/optional.js',
(/* warning */) => false,
],
},
});