-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwebpack.config.ts
More file actions
53 lines (50 loc) · 1.19 KB
/
Copy pathwebpack.config.ts
File metadata and controls
53 lines (50 loc) · 1.19 KB
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 * as path from 'path';
import * as webpack from 'webpack';
import WebpackUserscript from 'webpack-userscript';
const dev = process.env.NODE_ENV === 'development';
const config: webpack.Configuration = {
mode: dev ? 'development' : 'production',
entry: './src/index.ts',
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
}, {
test: /\.(png|jpg|gif)$/i,
use: [
{
loader: 'url-loader'
},
],
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'wojaker.bundle.js'
},
devServer: {
contentBase: path.join(__dirname, 'dist')
},
plugins: [
new WebpackUserscript({
headers: {
version: dev ? `[version]-build.[buildNo]` : `[version]`,
namespace: 'https://4chan.org',
include: 'https://*.4chan*.org/*',
grant: 'none'
},
proxyScript: {
baseUrl: 'http://127.0.0.1:12345',
filename: '[basename].proxy.user.js',
enable: () => process.env.LOCAL_DEV === '1'
}
})
]
};
export default config;