Netlify Identity Widget is being loaded on all pages in production
See original GitHub issueDescription
Netlify Identity Widget is being loaded on the index page in production. This makes user to load unnecessary 50kb of js.
Steps to reproduce
- Add gatsby-plugin-netlify-cms to gatsby project
npm run build
npm run serve
- Check network tab
Expected result
Netlify Identity Widget should be loaded only on the /admin
page
Actual result
Netlify Identity Widget is being loaded on all pages in production
Environment
System: OS: macOS Mojave 10.14 CPU: (4) x64 Intel® Core™ i7-5557U CPU @ 3.10GHz Shell: 5.3 - /bin/zsh Binaries: Node: 11.15.0 - /usr/local/bin/node Yarn: 1.21.1 - /usr/local/bin/yarn npm: 6.7.0 - /usr/local/bin/npm Languages: Python: 2.7.10 - /usr/bin/python Browsers: Chrome: 79.0.3945.130 Firefox: 72.0.1 Safari: 12.0 npmPackages: gatsby: 2.19.10 => 2.19.10 gatsby-image: 2.2.39 => 2.2.39 gatsby-plugin-netlify: 2.1.31 => 2.1.31 gatsby-plugin-netlify-cms: 4.1.37 => 4.1.37 gatsby-plugin-netlify-cms-paths: 1.3.0 => 1.3.0 gatsby-plugin-postcss: 2.1.19 => 2.1.19 gatsby-plugin-preact: 3.1.25 => 3.1.25 gatsby-plugin-react-helmet: 3.1.21 => 3.1.21 gatsby-plugin-sharp: 2.4.4 => 2.4.4 gatsby-plugin-svgr: 2.0.2 => 2.0.2 gatsby-plugin-typescript: 2.1.26 => 2.1.26 gatsby-plugin-webpack-bundle-analyzer: 1.0.5 => 1.0.5 gatsby-source-filesystem: 2.1.47 => 2.1.47 gatsby-source-hubspot: 2.0.3 => 2.0.3 gatsby-transformer-sharp: 2.3.13 => 2.3.13 gatsby-transformer-yaml: 2.2.23 => 2.2.23 npmGlobalPackages: gatsby-cli: 2.7.34
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (5 by maintainers)
Top GitHub Comments
Maybe worth adding this advice to the docs
Hi. I don’t know if it is better to open a new issue but trying what @erezrokah suggested above. When I try this, I see a blank page at /admin.
Here is the gatsby-config.js part:
And here is the gatsby-node.js part: