-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Netlify Identity Widget is being loaded on all pages in production #21086
Comments
Ok, I've just read this comment #17568 (comment) and understood that it's by design that widget is included on every page. But what I didn't fully understand, is what are the exact steps you should make to exclude Identity Widget from the bundle, while still being able to login to the admin page? I understood it has something to do with different redirect URLs, but didn't figure out the complete solution. Maybe it's worth writing small tutorial in docs? |
// cc @erezrokah |
This section was recently added to the readme: https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-netlify-cms#disable-widget-on-site |
mmm... I don't quite understand if following these instructions will still allow you to login via Identity Widget on the admin page? |
When using |
So, if you follow these instructions, you will still be able to login to |
Exactly, another option is use email templates to change the verification link to redirect to |
Awesome) that's exactly the piece I've been missing. Thank you. |
Maybe worth adding this advice to the docs |
@erezrokah looking at this code https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-netlify-cms/src/gatsby-browser.js The netlify-identity-widget should be lazy loaded. But in my project the netlify-identity-widget module is actually preloaded. Any idea why? |
Hi @steverandy what do you mean by lazy loaded? As long as you have When |
Looking at this line https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-netlify-cms/src/gatsby-browser.js#L16 The I think this is a bug. |
I recommend reading https://www.gatsbyjs.org/docs/how-code-splitting-works/ to understand how code splitting works in Gatsby. |
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:
|
Description
Netlify Identity Widget is being loaded on the index page in production. This makes user to load unnecessary 50kb of js.
Steps to reproduce
npm run build
npm run serve
Expected result
Netlify Identity Widget should be loaded only on the
/admin
pageActual result
Netlify Identity Widget is being loaded on all pages in production
Environment
System:
OS: macOS Mojave 10.14
CPU: (4) x64 Intel(R) Core(TM) 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
The text was updated successfully, but these errors were encountered: