Make sure the gatsby-plugin-intl is not present in node_modules and package.json.
If needed uninstall it:
npm uninstall gatsby-plugin-intl
To use my version of the plugin:
- Go inside your gatbsy repository (root directory)
- Create a folder called plugins:
mkdir plugins
- Add plugins to your .gitignore
- Clone this repository inside plugins:
cd plugins
git clone git@github.com:Jno21/gatsby-plugin-intl.git
cd gatsby-plugin-intl
git checkout generated-content
In gatsby-config.js
add or replace your gatsby-plugin-intl config by the following:
{
resolve: require.resolve(`./plugins/gatsby-plugin-intl`),
options: {
// Your usual options
},
},
The important thing is the resolve part ! You can configure the rest of the options as you want.
Now in the root folder of your project use this command:
npm link ./plugins/gatsby-plugin-intl
The plugin is now installed and work.
PS: if you add a new module doing an npm install
you might need to do rm -r ./plugins/gatsby-plugin-intl/node_modules
and npm link ./plugins/gatsby-plugin-intl
Hey @Jno21, good job, appreciate it.
But since we are ignoring this /plugins folder site cannot be deployed to Netlify, which is kind of big flaw since it won't work on any other CDN too (I guess).
To be honest I don't really understand this installation process, but wouldn't it be easier to just fork primary repo of gatsby-plugin-intl and make a new one which could be added to plugins?
It would be shame if your work won't be accessible to all people easily ;)