Skip to content

Commit 6404bd0

Browse files
renovate[bot]renovate-botmmkal
authored
chore(deps): update webpack (major) (#3)
* chore(deps): update devdependencies * fix: add node polyfills explicitly * add process * also provide buffer, setTimeout, setImmediate :( Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: mmkal <[email protected]>
1 parent a13d756 commit 6404bd0

File tree

6 files changed

+439
-1139
lines changed

6 files changed

+439
-1139
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
!test/**
1010
!scripts/**
1111
!patches/**
12+
!webpack/**

package.json

+9-2
Original file line numberDiff line numberDiff line change
@@ -52,22 +52,29 @@
5252
"devDependencies": {
5353
"@babel/core": "7.12.3",
5454
"@typescript-eslint/parser": "4.6.0",
55+
"assert": "2.0.0",
5556
"babel-loader": "8.1.0",
5657
"babel-plugin-transform-async-to-promises": "0.8.15",
58+
"buffer": "5.6.1",
5759
"eslint": "7.12.0",
5860
"eslint-plugin-codegen": "0.13.3",
5961
"eslint-plugin-prettier": "3.1.4",
6062
"isomorphic-git": "1.7.8",
6163
"jest": "26.6.1",
6264
"memfs": "3.2.0",
6365
"patch-package": "6.2.2",
66+
"path-browserify": "1.0.1",
6467
"prettier": "2.1.2",
68+
"process": "0.11.10",
6569
"slonik": "23.0.1",
70+
"stream-browserify": "3.0.0",
6671
"ts-jest": "26.4.2",
6772
"ts-loader": "8.0.7",
6873
"ts-node": "9.0.0",
6974
"typescript": "4.0.3",
70-
"webpack": "4.44.2",
71-
"webpack-cli": "3.3.12"
75+
"url": "0.11.0",
76+
"util": "0.12.3",
77+
"webpack": "5.2.0",
78+
"webpack-cli": "4.1.0"
7279
}
7380
}

webpack.config.js

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const path = require('path')
2+
const webpack = require('webpack')
23

3-
/** @type {import('webpack').Configuration} */
4+
/** @type {webpack.Configuration} */
45
module.exports = {
56
entry: path.join(__dirname, './src/index.ts'),
67
mode: 'none',
@@ -43,13 +44,25 @@ module.exports = {
4344
test: /async-lock/,
4445
use: [
4546
{
46-
loader: require.resolve('./scripts/async-lock-shim'),
47+
loader: require.resolve('./webpack/async-lock-shim'),
4748
},
4849
],
4950
},
5051
],
5152
},
5253
resolve: {
5354
extensions: ['.tsx', '.ts', '.js'],
55+
fallback: {
56+
path: require.resolve('path-browserify'),
57+
stream: require.resolve('stream-browserify'),
58+
},
5459
},
60+
plugins: [
61+
new webpack.ProvidePlugin({
62+
Buffer: ['buffer', 'Buffer'],
63+
process: [require.resolve('./webpack/globals'), 'process'],
64+
setTimeout: [require.resolve('./webpack/globals'), 'setTimeout'],
65+
setInterval: [require.resolve('./webpack/globals'), 'setInterval'],
66+
}),
67+
],
5568
}
File renamed without changes.

webpack/globals.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports.process = {
2+
env: {},
3+
}
4+
module.exports.setTimeout = () => {
5+
throw new Error(`Can't use setTimeout in postgres!`)
6+
}
7+
module.exports.setInterval = () => {
8+
throw new Error(`Can't use setInterval in postgres!`)
9+
}

0 commit comments

Comments
 (0)