-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.ts
53 lines (51 loc) · 1.35 KB
/
webpack.config.ts
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
import path from 'path';
import webpack from 'webpack';
import pkg from './package.json';
const config: webpack.Configuration = {
mode: process.env.NODE_ENV !== 'production' ? 'development' : 'production',
entry: {
tampermonkey: {
import: path.resolve(
__dirname,
'plugins/tampermonkey/remove-copy-watermark.user.js'
),
filename: 'bin/' + `${pkg.name}.user.js`,
},
},
devtool: 'inline-source-map',
module: {
rules: [
{
exclude: /node_modules/,
loader: 'babel-loader',
test: /\.[tj]sx?$/,
},
],
},
resolve: {
extensions: ['.ts', '.js'],
},
plugins: [
new webpack.SourceMapDevToolPlugin({
include: [/\.user\.[tj]sx?$/],
}),
new webpack.BannerPlugin({
test: /\.user\.[tj]sx?$/,
raw: true,
banner: `
// ==UserScript==
// @namespace https://github.com/jeffreytse
// @name Remove Copy Watermark
// @description ${pkg.description}
// @version ${pkg.version}
// @author ${pkg.author}
// @license ${pkg.license}
// @copyright 2022, ${pkg.license}
// @match *://*/*
// @grant none
// @run-at document-start
// ==/UserScript==`.replace(/^\s+/gm, ''),
}),
],
};
export default config;