-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathwebpack.config.js
More file actions
57 lines (55 loc) · 1.41 KB
/
webpack.config.js
File metadata and controls
57 lines (55 loc) · 1.41 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
54
55
56
57
'use strict';
const path = require('node:path');
const { ProvidePlugin } = require('webpack');
module.exports = require('tailpack').reactSpa({
cwd: __filename,
dotenv: false,
output: {
library: '_SKK',
path: path.resolve(__dirname, 'dist'),
filenamePrefix: '/_sukka/static/',
filenameContainChunkName: false
},
devServerPort: 3000,
spa: true,
externals: {
'isomorphic-fetch': 'fetch',
'node-fetch': 'fetch',
// requires to build @undecaf/zbar.wasm
module: 'module'
},
browserlists: 'defaults, chrome > 70, edge >= 79, firefox esr, safari >= 11, not dead, not ie > 0, not ie_mob > 0, not OperaMini all',
reactCompiler: true,
webpackExperimentalBuiltinCssSupport: true,
htmlTemplatePath: './src/index.html',
sourcemap: {
production: false
}
}, {
resolve: {
fallback: {
https: false,
http: false
// crypto: require.resolve('crypto-browserify'),
// stream: require.resolve('stream-browserify'),
},
tsconfig: path.resolve(__dirname, 'tsconfig.json')
},
devServer: {
proxy: [
{
context: ['/_sukka/api'],
target: 'https://api.cloudflare.com',
pathRewrite: { '^/_sukka/api': '' },
secure: false,
changeOrigin: true
}
]
},
plugins: [
new ProvidePlugin({
// Polyfill for Node global "Buffer" variable
Buffer: [require.resolve('buffer'), 'Buffer']
})
]
});