forked from dear-clouds/better-mdl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
57 lines (56 loc) · 1.88 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
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: {
publicPath: '/',
},
plugins: [
new WebpackUserscript({
headers: {
name: "Better MDL",
namespace: "https://dear-clouds.carrd.co/#better-mdl",
version: packageJson.version,
author: "Mio.",
match: ["*://www.mydramalist.com/*", "*mydramalist.com/*"],
description: "An enhance version making the website 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, 'dist'),
},
compress: true,
port: 8080,
hot: true,
headers: {
"Access-Control-Allow-Origin": "*",
},
},
};