-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathwebpack.common.ts
45 lines (43 loc) · 1.21 KB
/
webpack.common.ts
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
import CircularDependencyPlugin from "circular-dependency-plugin";
import { WebpackPluginFunction } from "webpack";
import { WebpackConfiguration } from "webpack-cli";
import { paths } from "./webpack.parts";
export const common: WebpackConfiguration = {
entry: paths.entry,
mode: "none",
optimization: {
minimize: true,
emitOnErrors: false,
},
plugins: [
new CircularDependencyPlugin({
// exclude detection of files based on a RegExp
exclude: /a\.js|node_modules/,
// include specific files based on a RegExp
include: /src/,
// add errors to webpack instead of warnings
failOnError: false,
// allow import cycles that include an asynchronous import,
// e.g. via import(/* webpackMode: "weak" */ './file.js')
allowAsyncCycles: false,
// set the current working directory for displaying module paths
cwd: process.cwd(),
}) as WebpackPluginFunction,
],
resolve: {
extensions: [".js"],
modules: ["node_modules"],
fallback: {
os: false,
crypto: false,
url: false,
https: false,
http: false,
assert: false,
path: false,
stream: false,
zlib: false,
fs: false,
},
},
};