-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
58 lines (57 loc) · 1.97 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
const WebpackUserscript = require("webpack-userscript").default;
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const packageJson = require("./package.json");
const path = require('path');
module.exports = {
mode: "production",
entry: {
"better-mdl": "./src/index.js",
},
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
],
},
resolve: {
fallback: {
url: require.resolve('url'),
path: require.resolve('path-browserify'),
},
},
output: {
path: path.resolve(__dirname),
},
plugins: [
new WebpackUserscript({
headers: {
name: "Better MDL",
namespace: "https://dear-clouds.carrd.co/#better-mdl",
version: packageJson.version,
author: "Mio.",
// licence: "GPL3",
match: ["*://*.mydramalist.com/*"],
description: "A userscript to enhance the website by making it more friendly & modern",
downloadURL: "https://github.com/dear-clouds/better-mdl/raw/main/better-mdl.user.js",
updateURL: "https://github.com/dear-clouds/better-mdl/raw/main/better-mdl.meta.js",
supportURL: "https://mydramalist.com/discussions/general-discussion/88611-gathering-feedbacks",
grant: ["GM_addStyle", "GM.xmlHttpRequest", "GM_getValue"],
icon: "https://github.com/dear-clouds/better-mdl/raw/main/images/favicon.png",
},
}),
// new BundleAnalyzerPlugin(),
],
devServer: {
static: {
directory: path.join(__dirname, '/'),
},
compress: true,
port: 8080,
hot: true,
headers: {
"Access-Control-Allow-Origin": "*",
},
},
};