-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
46 lines (41 loc) · 1018 Bytes
/
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
const path = require('path');
const CloudflareWorkerPlugin = require('cloudflare-worker-webpack-plugin');
const { DefinePlugin } = require('webpack');
const {
CLOUDFLARE_AUTH_EMAIL,
CLOUDFLARE_AUTH_KEY,
RPC_KEY,
STORAGE_URL,
} = require('./config.json');
const log = console.log;
console.log = function () {
console.dir([...arguments], {depth: null});
};
module.exports = {
entry: [
path.join(__dirname, 'lib', 'index.js'),
],
output: {
filename: 'bundle.js',
path: path.join(__dirname, 'dist'),
},
plugins: [
new CloudflareWorkerPlugin(CLOUDFLARE_AUTH_EMAIL, CLOUDFLARE_AUTH_KEY, {
site: 'notsobot.com',
enabledPatterns: [
'*notsobot.com',
'*notsobot.com/*',
],
disabledPatterns: [
'notsobot.com/api/*',
'beta.notsobot.com/api/*',
],
scriptName: 'notsobot-com',
verbose: true,
}),
new DefinePlugin({
__RPC_KEY__: `'${RPC_KEY}'`,
__STORAGE_URL__: `'${STORAGE_URL}'`,
}),
],
};