fix(client): polyfill path with path-browserify (#41615)

path is being used by webpack to transform imports into requires. Since
some challenges rely on this transformation, path has to exist in the
browser.
This commit is contained in:
Oliver Eyton-Williams
2021-03-27 14:49:30 +01:00
committed by GitHub
parent 8df5293af3
commit e91793b934
3 changed files with 7 additions and 1 deletions

View File

@ -204,7 +204,7 @@ exports.onCreateWebpackConfig = ({ stage, plugins, actions }) => {
resolve: {
fallback: {
fs: false,
path: false,
path: require.resolve('path-browserify'),
assert: require.resolve('assert'),
crypto: require.resolve('crypto-browserify'),
util: false,

View File

@ -18989,6 +18989,11 @@
"cross-spawn": "^6.0.5"
}
},
"path-browserify": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz",
"integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g=="
},
"path-dirname": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz",

View File

@ -50,6 +50,7 @@
"lodash": "^4.17.21",
"monaco-editor": "^0.22.3",
"nanoid": "^3.1.22",
"path-browserify": "^1.0.1",
"prismjs": "^1.23.0",
"process": "^0.11.10",
"query-string": "^6.14.1",