-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.cjs.config.js
More file actions
44 lines (41 loc) · 1.03 KB
/
webpack.cjs.config.js
File metadata and controls
44 lines (41 loc) · 1.03 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
"use strict";
import { fileURLToPath } from 'url';
import { dirname } from 'path';
// Get the file URL of the current module
const __filename = fileURLToPath(import.meta.url);
// Derive the directory name
const __dirname = dirname(__filename);
export default [
{
entry: "./src/index.js",
mode: "production",
output: {
path: __dirname,
filename: "./lib/pem.cjs",
// library: "fxp",
libraryTarget: "commonjs2"
},
target: "node"
}, {
context: __dirname,
entry: "./src/index.js",
mode: "production",
devtool: "source-map",
output: {
path: __dirname,
filename: "./lib/pem.min.js",
library: "pem",
libraryTarget: "umd",
globalObject: "this"
},
module: {
rules: [
{
test: /\.js$/,
loader: "babel-loader"
}
]
},
target: "web"
}
];