-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
79 lines (69 loc) · 3.05 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
73
74
75
76
77
78
79
const path = require('path');
const { UserscriptPlugin } = require('webpack-userscript');
const TerserPlugin = require('terser-webpack-plugin');
const dev = process.env.NODE_ENV === 'development';
module.exports = {
mode: dev ? 'development' : 'production',
entry: path.resolve(__dirname, 'src', 'index.js'), // Your entry point
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'CSN.user.js', // Output file
},
devServer: {
static: {
directory: path.join(__dirname, 'dist'),
},
client: false, // Disable client injection
hot: false, // Disable hot reloading
},
optimization: {
minimize: dev ? false : true,
minimizer: [
new TerserPlugin({
terserOptions: {
compress: {
drop_console: dev ? false : true,
},
},
}),
],
},
plugins: [
new UserscriptPlugin({
headers(original) {
const baseHeaders = {
name: 'Captcha Solver For Neptun',
namespace: 'https://github.com/LetsUpdate/CSN',
description: 'No captcha 4 u',
author: 'RED',
include: [
'https://*neptun*/*hallgato*/*',
'https://*neptun*/*Hallgatoi*/*',
'https://*hallgato*.*neptun*/*',
'https://netw*.nnet.sze.hu/hallgato',
'https://nappw.dfad.duf.hu/hallgato/*',
],
grant: 'GM_xmlhttpRequest',
"run-at": "document-end",
require: "https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js",
updateURL: "https://github.com/LetsUpdate/CSN/releases/latest/download/CSN.meta.js",
downloadURL:"https://github.com/LetsUpdate/CSN/releases/latest/download/CSN.user.js",
supportURL:"https://github.com/LetsUpdate/CSN",
icon64: "https://raw.githubusercontent.com/LetsUpdate/CSN/main/.github/icon.png",
license: "MIT",
};
if (dev) {
return {
...original,
...baseHeaders,
version: `${original.version}-build.[buildNo]`,
};
}
return {
...original,
...baseHeaders,
};
},
}),
],
};