Skip to content

Commit

Permalink
upgrade to gatsby 4 and some plugins (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nebulis authored Feb 19, 2024
1 parent 5987ed3 commit e056fc4
Show file tree
Hide file tree
Showing 7 changed files with 21,680 additions and 32,763 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module.exports = {
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error",
"@emotion/pkg-renaming": "error",
"react/no-unknown-property": ["error", { ignore: ["css"] }],
},
overrides: [
{
Expand Down
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,3 @@
## Dependencies update

- plop v3 does not support typescript https://github.com/plopjs/plop/issues/296
- gatsby v4 does not work on netlify
- https://app.netlify.com/teams/nebulis/builds/61c6703a9d14182e91394d08
- https://github.com/gatsbyjs/gatsby/issues/33738
- as a result the following dependencies was downgraded
- all gatsby plugins
- eslint
=> reverted to the initial versions https://github.com/Nebulis/blog/pull/165/files
6 changes: 3 additions & 3 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ const pages = (page) => {
}
module.exports = {
flags: {
// FAST_DEV: true,
PRESERVE_WEBPACK_CACHE: true,
// DEV_SSR: false, // can't disable this fucker
FAST_DEV: true,
PRESERVE_FILE_DOWNLOAD_CACHE: true,
DEV_SSR: false, // can't disable this fucker
},
siteMetadata: {
siteUrl: `https://magicoftravels.com`,
Expand Down
22 changes: 11 additions & 11 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports.onCreatePage = ({ page, actions }) => {
createPage(newPage)
// }
}
exports.onCreateWebpackConfig = ({ stage, actions, getConfig }) => {
exports.onCreateWebpackConfig = ({ stage, actions, getConfig, plugins }) => {
const PATTERN = /\.(eot|otf|ttf|woff(2)?)(\?.*)?$/

const config = getConfig()
Expand All @@ -32,20 +32,20 @@ exports.onCreateWebpackConfig = ({ stage, actions, getConfig }) => {
}

// migration v2 to v3
// if (stage === "build-javascript" || stage === "develop") {
// config.plugins.push(plugins.provide({ process: "process/browser" }))
// }
if (stage === "build-javascript" || stage === "develop") {
config.plugins.push(plugins.provide({ process: "process/browser" }))
}

const newConfig = {
...config,
// migration v2 to v3
// resolve: {
// ...config.resolve,
// alias: {
// ...config.resolve.alias,
// path: require.resolve("path-browserify"),
// },
// },
resolve: {
...config.resolve,
alias: {
...config.resolve.alias,
path: require.resolve("path-browserify"),
},
},
module: {
// Manually swap out the rule who's test matches PATTERN
rules: config.module.rules.map((rule) => {
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ module.exports = {
moduleNameMapper: {
".+\\.(css|styl|less|sass|scss)$": `identity-obj-proxy`,
".+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": `<rootDir>/src/__mocks__/file-mock.js`,
"^gatsby-page-utils/(.*)$": `gatsby-page-utils/dist/$1`, // Workaround for https://github.com/facebook/jest/issues/9771
},
// transformIgnorePatterns: [`node_modules/(?!(gatsby)/)`],
globals: {
__PATH_PREFIX__: ``,
},
Expand Down
Loading

0 comments on commit e056fc4

Please sign in to comment.