It's no possible to upgrade to the Gatsby v3 right now, because the nx gatsby plugin (code) doesn't support it
- check how the Gatsby works with Nx
implicit - means some sort of manual configuration
- at the first try it's possible to add the Gatsby site inside of the nx workspace, the only point until now was to add the support to the project it was needed to run the following command:
npm i --save-dev @nrwl/gatsby gatsby-cli
- to run the gatsby generate site inside of the nx workspace you should use the command:
nx serve <generated-site-name>
(on this example it was gatsby
)
-
when I tried to run the lint over the e2e tests of the gatsby I notice a wrong configuration on the
workspace.json
which was set to theapps/gatsby-e2e
, where it should use the same lint runner as theapps/gatsby
-
when I runned the lint over the
apps/gatsby
I get some warning messages, to remove them, I needed to change the lint configuration on theworkspace.json
to ignore theapps/gatsby/public
folder -
using the Gatsby inside of the Nx workspace it's basically like have 2 react applications, nothing special was notice to be able to use it
-
to map the
libs/assets
into the gatsby application it was needed some extra manual steps because the gatsby doesn't supports thebaseUrl
from thetsconfig.base.json
-
Nx: Extensible Dev Tools for Monorepos (React)
-
[YouTube] Nx Tutorial: High Quality React apps with Nx, Storybook & Cypress
-
Gatsby support, custom workspace layouts, and more in Nx 9.4! | Nrwl
-
[GitHub] nrwl/gatsby - Nx plugin for Gatsby
-
React Microfrontends and Monorepos: A Perfect Match | Nrwl - demo | code
-
to make my life easier I have the current
node_modules
from the project mapped to the PATH env variable, that enables me to run the commandnx
directly, if you don't have if you must use the short cut mapped on thepackage.json
, using it likenpm run nx ...
or it's also possible to use likenpx nx ...
(thenpx
will look into the local installed packages./node_modules/
and on the global installed packages)./node_modules/.bin
-
gatsby-plugin-typescript caveats
Does not support baseUrl. Workaround: use gatsby-plugin-root-import and configure it to point the baseUrl value (also set baseUrl option in tsconfig.json file).