This repository was archived by the owner on Oct 5, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.config.js
72 lines (70 loc) · 2.11 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
const { version, description } = require("./package.json");
const path = require("path").posix;
const webpack = require("webpack");
const os = require("os");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const OptimizeCssAssetsPlugin = require("optimize-css-assets-webpack-plugin");
// YYYY-MM-DD format
const dateOfBuild = new Date().toISOString().slice(0, 10);
const name = "macOSNotifJS";
const versionInfo = `${name} - v${version} - ${dateOfBuild}`;
const copyrights = `${name}: ${description}
<https://github.com/MattIPv4/macOSNotifJS/>
Copyright (C) 2019 Matt Cowley (MattIPv4) ([email protected])`;
module.exports = {
mode: "production",
target: "web",
entry: [
"core-js/fn/object/entries",
path.join(__dirname, "src/macOSNotif.js"),
],
output: {
path: path.join(__dirname, "dist"),
filename: "macOSNotif.min.js",
},
module: {
rules: [
{
test: /\.js$/,
use: ["babel-loader"],
},
{
test: /\.css$/,
use: [{
loader: MiniCssExtractPlugin.loader,
}, {
loader: "css-loader",
}],
},
{
test: /\.(ttf|eot|otf|woff(2)?)(\?[a-z0-9=&.]+)?$/,
use: {
loader: "file-loader",
options: {
name: "./fonts/[name].[ext]",
},
},
},
{
test: /\.html$/,
use: [{
loader: "html-loader",
}],
},
{
test: /\.(ogg|mp3|caf|wav|mpe?g)$/i,
use: {
loader: "url-loader",
},
},
],
},
plugins: [
new MiniCssExtractPlugin({
filename: "macOSNotif.min.css",
allChunks: true,
}),
new OptimizeCssAssetsPlugin({}),
new webpack.BannerPlugin(`${versionInfo}${os.EOL}${os.EOL}${copyrights}${os.EOL}`),
],
};