Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gatsby): use webpack fs caching in prod behind feature flag (#30857
) * tmp * add infrastructure logging for webpack caching * add hooks * no weird import * wait for webpack fs caching to finish * handle build-html * fix develop (?) * adjust artifcats ssr to match structure of browser so things render properly in browser * clean webpack config * add test cases for changing webpack plugins and cache invalidation * add parentspans to activities * enable fs caching behind feature flag * show notice about persistent webpack caching when building js bundle takes longer than 30s * bump minimum webpack to contain fix for resolving paths containing #
- Loading branch information
Showing
19 changed files
with
493 additions
and
34 deletions.
There are no files selected for viewing
This file contains 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 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 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
7 changes: 7 additions & 0 deletions
7
integration-tests/artifacts/plugins/gatsby-plugin-webpack-1/gatsby-node.js
This file contains 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const MyLocalPlugin = require(`./local-webpack-plugin`) | ||
|
||
exports.onCreateWebpackConfig = ({ actions }) => { | ||
actions.setWebpackConfig({ | ||
plugins: [new MyLocalPlugin()], | ||
}) | ||
} |
13 changes: 13 additions & 0 deletions
13
integration-tests/artifacts/plugins/gatsby-plugin-webpack-1/local-webpack-plugin.js
This file contains 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const { DefinePlugin } = require(`webpack`) | ||
|
||
module.exports = class LocalWebpackPlugin1 { | ||
constructor() { | ||
this.plugin = new DefinePlugin({ | ||
REPLACE_ME_1: JSON.stringify(`localWebpackPlugin1_1`), | ||
}) | ||
} | ||
|
||
apply(compiler) { | ||
this.plugin.apply.call(this.plugin, compiler) | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
integration-tests/artifacts/plugins/gatsby-plugin-webpack-1/package.json
This file contains 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
1 change: 1 addition & 0 deletions
1
integration-tests/artifacts/plugins/gatsby-plugin-webpack-2/gatsby-node.js
This file contains 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
exports.onCreateWebpackConfig = require(`./on-create-webpack-config`) |
19 changes: 19 additions & 0 deletions
19
integration-tests/artifacts/plugins/gatsby-plugin-webpack-2/on-create-webpack-config.js
This file contains 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { DefinePlugin } = require(`webpack`) | ||
|
||
class LocalWebpackPlugin2 { | ||
constructor() { | ||
this.plugin = new DefinePlugin({ | ||
REPLACE_ME_2: JSON.stringify(`localWebpackPlugin2_1`), | ||
}) | ||
} | ||
|
||
apply(compiler) { | ||
this.plugin.apply.call(this.plugin, compiler) | ||
} | ||
} | ||
|
||
module.exports = ({ actions }) => { | ||
actions.setWebpackConfig({ | ||
plugins: [new LocalWebpackPlugin2()], | ||
}) | ||
} |
1 change: 1 addition & 0 deletions
1
integration-tests/artifacts/plugins/gatsby-plugin-webpack-2/package.json
This file contains 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
Oops, something went wrong.