Open ptrobert opened 4 years ago
can we pass some thing like this currently
{
resolve:gatsby-plugin-no-javascript
,
options:{
excludePaths:'/contactus',
excludePaths:'/partners',
}
}
@ptrobert
Thank you for the feedback, I will look at implementing this feature tonight.
I just discovered this plugin (thanks for making it!). From what I can tell, excludePaths
is used like a regex, similar to excludeFiles
. So I think @ptrobert you can get what you are after with excludePaths: '(/contactus|/partners)'
The README says excludePaths
is an array of strings, but I don't think that is correct.
@city41 Hello , can you please tell me how can i use this excludePaths , lets say i have a page www.mysite.de/foo/bar/
and i only want to keep JS for this page only in my website , is this possible? i tried
{
resolve: 'gatsby-plugin-no-javascript',
options: {
excludePaths: '/foo',
// excludePaths: 'foo',
// excludePaths: '/foo/bar',
// excludePaths: '/foo/bar/',
},
}
but seems like its not working .
Here's an example of using multiple values in excludePaths
:
{
resolve: "gatsby-plugin-no-javascript",
options: {
excludePaths: [
"blog/(index.+)?$",
"404",
"error",
"support/?$",
"contact/?$"
]
.map(path => `(${path})`)
.join("|")
}
}
Need multiple paths for excluding paths or files
We need the ability to exclude multiple paths like partners, contactus etc