Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Webpack dev server config before and after middleware and renderExample path #3110

Merged
merged 5 commits into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions custom-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ listbox
listvalues
matchingbracket
marko
middlewares
modulemap
myschema
newhope
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"webpack": "5.76.0",
"webpack-bundle-analyzer": "^3.6.1",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.11.1",
"webpack-dev-server": "^4.13.1",
mylesmmurphy marked this conversation as resolved.
Show resolved Hide resolved
"ws": "^8.3.0"
}
}
2 changes: 1 addition & 1 deletion packages/graphiql/resources/index.html.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</script>
<script
defer
src="/resources/renderExample.js"
src="/renderExample.js"
type="application/javascript"
></script>
</body>
Expand Down
8 changes: 6 additions & 2 deletions packages/graphiql/resources/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ const resultConfig = {
// bypass simple localhost CORS restrictions by setting
// these to 127.0.0.1 in /etc/hosts
allowedHosts: ['local.example.com', 'graphiql.com'],
before: require('../test/beforeDevServer'),
after: require('../test/afterDevServer'),
setupMiddlewares: (middlewares, devServer) => {
require('../test/beforeDevServer')(devServer.app);
require('../test/afterDevServer')();

return middlewares;
},
},
devtool: isDev ? 'cheap-module-source-map' : 'source-map',
externals: {
Expand Down
54 changes: 54 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11541,6 +11541,14 @@ klona@^2.0.5:
resolved "https://registry.yarnpkg.com/klona/-/klona-2.0.6.tgz#85bffbf819c03b2f53270412420a4555ef882e22"
integrity sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==

launch-editor@^2.6.0:
version "2.6.0"
resolved "https://registry.yarnpkg.com/launch-editor/-/launch-editor-2.6.0.tgz#4c0c1a6ac126c572bd9ff9a30da1d2cae66defd7"
integrity sha512-JpDCcQnyAAzZZaZ7vEiSqL690w7dAEyLao+KC96zBplnYbJS7TYNjvM3M7y3dGz+v7aIsJk3hllWuc0kWAjyRQ==
dependencies:
picocolors "^1.0.0"
shell-quote "^1.7.3"

lazy-ass@1.6.0, lazy-ass@^1.6.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/lazy-ass/-/lazy-ass-1.6.0.tgz#7999655e8646c17f089fdd187d150d3324d54513"
Expand Down Expand Up @@ -15046,6 +15054,11 @@ shebang-regex@^3.0.0:
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==

shell-quote@^1.7.3:
version "1.8.0"
resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.8.0.tgz#20d078d0eaf71d54f43bd2ba14a1b5b9bfa5c8ba"
integrity sha512-QHsz8GgQIGKlRi24yFc6a6lN69Idnx634w49ay6+jA5yFh7a1UY+4Rp6HPx/L/1zcEDPEij8cIsiqR6bQsE5VQ==

shelljs@^0.8.4:
version "0.8.4"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2"
Expand Down Expand Up @@ -16838,6 +16851,42 @@ webpack-dev-server@^4.11.1:
webpack-dev-middleware "^5.3.1"
ws "^8.4.2"

webpack-dev-server@^4.13.1:
version "4.13.1"
resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-4.13.1.tgz#6417a9b5d2f528e7644b68d6ed335e392dccffe8"
integrity sha512-5tWg00bnWbYgkN+pd5yISQKDejRBYGEw15RaEEslH+zdbNDxxaZvEAO2WulaSaFKb5n3YG8JXsGaDsut1D0xdA==
dependencies:
"@types/bonjour" "^3.5.9"
"@types/connect-history-api-fallback" "^1.3.5"
"@types/express" "^4.17.13"
"@types/serve-index" "^1.9.1"
"@types/serve-static" "^1.13.10"
"@types/sockjs" "^0.3.33"
"@types/ws" "^8.5.1"
ansi-html-community "^0.0.8"
bonjour-service "^1.0.11"
chokidar "^3.5.3"
colorette "^2.0.10"
compression "^1.7.4"
connect-history-api-fallback "^2.0.0"
default-gateway "^6.0.3"
express "^4.17.3"
graceful-fs "^4.2.6"
html-entities "^2.3.2"
http-proxy-middleware "^2.0.3"
ipaddr.js "^2.0.1"
launch-editor "^2.6.0"
open "^8.0.9"
p-retry "^4.5.0"
rimraf "^3.0.2"
schema-utils "^4.0.0"
selfsigned "^2.1.1"
serve-index "^1.9.1"
sockjs "^0.3.24"
spdy "^4.0.2"
webpack-dev-middleware "^5.3.1"
ws "^8.13.0"

webpack-merge@^5.7.3:
version "5.8.0"
resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-5.8.0.tgz#2b39dbf22af87776ad744c390223731d30a68f61"
Expand Down Expand Up @@ -17108,6 +17157,11 @@ ws@^6.0.0:
dependencies:
async-limiter "~1.0.0"

ws@^8.13.0:
version "8.13.0"
resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0"
integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==

ws@^8.3.0:
version "8.3.0"
resolved "https://registry.yarnpkg.com/ws/-/ws-8.3.0.tgz#7185e252c8973a60d57170175ff55fdbd116070d"
Expand Down