forked from travist/jsencrypt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
42 lines (40 loc) · 1.07 KB
/
webpack.config.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
import path from "path";
import * as url from "url";
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
import pkg from "webpack";
const { ProvidePlugin, DefinePlugin } = pkg;
export default {
entry: path.join(path.resolve(__dirname, "lib"), "index.js"),
output: {
library: "JSEncrypt",
libraryTarget: "umd",
libraryExport: "default",
globalObject: "window",
path: path.resolve(__dirname, "bin"),
filename: "jsencrypt.js",
},
mode: "development",
performance: { hints: false },
module: {
rules: [
{
test: /\.m?js/,
type: "javascript/auto",
},
{
test: /\.m?js/,
resolve: {
fullySpecified: false,
},
},
],
},
plugins: [
new ProvidePlugin({
process: "process/browser",
}),
new DefinePlugin({
"process.env.npm_package_version": `${require("./package.json").version}`,
}),
],
};