generated from UCProjects/plugin-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
33 lines (31 loc) · 1.02 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
/* eslint-env node */
const path = require('path');
const WebpackUserscript = require('webpack-userscript');
const { name, scriptName, description, repository } = require('./package.json');
const dev = process.argv.includes('--dev');
module.exports = {
mode: dev ? 'development' : 'production',
entry: path.resolve(__dirname, 'src', 'index.js'),
output: {
path: path.resolve(__dirname, 'dist'),
filename: `${name}.user.js`,
// libraryTarget: 'this',
},
plugins: [
new WebpackUserscript({
headers: {
name: scriptName,
description,
namespace: 'https://uc.feildmaster.com/',
match: 'https://*.undercards.net/*',
exclude: 'https://*.undercards.net/*/*',
updateURL: `https://github.com/${repository}/releases/latest/download/${name}.meta.js`,
downloadURL: `https://github.com/${repository}/releases/latest/download/${name}.user.js`,
require: [ // URLS of files to require
],
grant: 'none',
},
pretty: true,
}),
],
};