Comments (5)
I think that prefixing script.name
with __PATH_PREFIX__
in
`/${script.name}` === headComponent.props.href &&
and in
return pageScripts.find((script): boolean => postBodyComponent.type === 'script' && `/${script.name}` === postBodyComponent.props.src) === undefined
should help. Please mind that I have not tested this thoroughly.
I also noticed that the "polyfill" script does not get removed, so the existing filter should be updated to cover this script too.
from gatsby-plugin-no-javascript.
I think that prefixing
script.name
with__PATH_PREFIX__
in`/${script.name}` === headComponent.props.href &&and in
return pageScripts.find((script): boolean => postBodyComponent.type === 'script' && `/${script.name}` === postBodyComponent.props.src) === undefinedshould help. Please mind that I have not tested this thoroughly.
I also noticed that the "polyfill" script does not get removed, so the existing filter should be updated to cover this script too.
Thanks a lot, @mcagalj! Your tip was very helpful.
I did my own fix on the outside of the npm package, as I am a little newbie with package management.
If anyone needs the correction urgently, here it is.
Just create the gatsby-ssr.js file at the root of the project
https://gist.github.com/joaocarloscabral/1173496642a15772d13815126ee1dc73
from gatsby-plugin-no-javascript.
Can confirm this is happening.
from gatsby-plugin-no-javascript.
Me too. I can't use the plugin now on a blog that lives in a subdirectory.
from gatsby-plugin-no-javascript.
I also ran into having my polyfill spared.
from gatsby-plugin-no-javascript.
Related Issues (11)
- Need mutiple paths for excluding paths or files HOT 5
- Also remove page-data.json
- Remove JavaScript from specific pages HOT 1
- Gatsby v3 support (peer dep)
- gatsby-plugin-image breaks on iOS HOT 9
- Not working with latest Gatsby version 3.14.2
- Gatsby 5.2.0 introduces unstripped scripts HOT 1
- Delete unused Javascript Files in Public HOT 2
- noscript is still in HTML HOT 2
- page-data is still preloaded HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-plugin-no-javascript.