/
webpack.common.js
52 lines (51 loc) · 945 Bytes
/
webpack.common.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
const path = require("path");
/**
* @type {import("webpack").Configuration}
*/
module.exports = {
bail: true,
cache: true,
entry: "./src/index.ts",
externals: ["undici"],
externalsPresets: { node: true, web: true },
mode: "none",
module: {
rules: [
{
test: /\.ts$/,
use: [
{
loader: "ts-loader",
options: { transpileOnly: true, happyPackMode: true },
},
],
exclude: path.join(__dirname, "node_modules"),
},
],
},
name: "Base",
optimization: {
concatenateModules: true,
mergeDuplicateChunks: true,
removeEmptyChunks: true,
},
output: {
clean: true,
filename: "index.js",
globalObject: "this",
library: {
name: "portaleargoApi",
type: "umd",
},
libraryTarget: "umd",
path: path.resolve(__dirname, "dist"),
publicPath: "",
asyncChunks: true,
},
resolve: {
extensions: [".ts", ".js"],
symlinks: false,
cache: true,
cacheWithContext: true,
},
};