-
Notifications
You must be signed in to change notification settings - Fork 380
/
webpack.config.js
48 lines (45 loc) · 1 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
43
44
45
46
47
48
const webpack = require("webpack");
const TerserPlugin = require("terser-webpack-plugin");
const { version, author, license } = require("./package.json");
module.exports = {
mode: "production",
entry: {
NoSleep: `${__dirname}/src/index.js`,
"NoSleep.min": `${__dirname}/src/index.js`,
},
output: {
path: `${__dirname}/dist`,
filename: "[name].js",
library: "NoSleep",
libraryTarget: "umd",
globalObject: "this",
},
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: "babel-loader",
options: {
presets: ["env"],
},
},
},
],
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
test: /\.min\.js(\?.*)?$/i,
extractComments: false,
}),
],
},
plugins: [
new webpack.BannerPlugin({
banner: `[name].js v${version} - git.io/vfn01 - ${author} - ${license} license`,
}),
],
};