-
Notifications
You must be signed in to change notification settings - Fork 20
/
webpack.common.js
53 lines (51 loc) · 1.31 KB
/
webpack.common.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
47
48
49
50
51
52
53
/**
* All test logic lives in the Karma files - (any difference in test bundles happens there)
* The only env differences is prod vs dev - the tests work in both environments.
*/
// external
const { join } = require('path');
const { ProvidePlugin } = require('webpack');
module.exports = {
entry: {
main: join(__dirname, 'src', 'index.ts'),
worker: join(__dirname, 'src', 'worker.penumbra.js'),
},
output: {
filename: '[name].penumbra.js',
path: join(__dirname, 'dist'),
},
resolve: {
extensions: ['.ts', '.js'],
// TODO: https://github.com/transcend-io/penumbra/issues/155 - webpack 5
// fallback: {
// path: require.resolve('path-browserify'),
// stream: require.resolve('stream-browserify'),
// },
},
watch: false,
module: {
rules: [
{
test: /\.(j|t)s$/,
use: {
loader: 'babel-loader',
},
},
],
},
performance: {
hints: false,
maxEntrypointSize: 512000,
maxAssetSize: 512000,
},
// TODO: https://github.com/transcend-io/penumbra/issues/155 - webpack 5
// plugins: [
// new ProvidePlugin({
// Buffer: ['buffer', 'Buffer'],
// process: 'process/browser',
// }),
// ],
// devtool: 'source-map',
devtool: '',
target: 'web', // Make web variables accessible to webpack, e.g. window
};