-
Notifications
You must be signed in to change notification settings - Fork 33
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
Added the ability to exclude frontend reload script injection via configuration #1457
base: main
Are you sure you want to change the base?
Conversation
@@ -163,6 +163,35 @@ describe('frontend reload', () => { | |||
assert(res.text.includes('<script src=\'/reloadHttp/reload.js\'></script>')) | |||
}) | |||
|
|||
it('should exclude multiple glob paths for auto inject reload script into rendered html', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wording isn't great...
f9ea044
to
ee51f01
Compare
} | ||
}) | ||
|
||
// check that reload script is injected into response bodies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy/paste comment is no longer correct
|
||
router.route('/HTMLTest/nested').get((req, res) => { | ||
// save the path of the plain HTML page | ||
const htmlPath = path.join(__dirname, '../views/plainHTMLTest.html') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make these more re-useable later and semantically correct we might want new .html documents.
Let me know and I can update
…b patterns at the server configuration level. * Added minimatch as a dependency * Added new tests to test reload excludeRoutes * Added default excludeRoutes as empty array
We need to hold merge on this for a bit, the test was working before but now it's breaking and there are recursion depth problems that could cause performance issues. Need to handle both of those items before merging |
} | ||
``` | ||
|
||
- `excludeRoutes`: Reload auto script injection happens on all HTML routes by default unless specified in `excludeRoutes`. An array of valid glob patterns is accepted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `excludeRoutes`: Reload auto script injection happens on all HTML routes by default unless specified in `excludeRoutes`. An array of valid glob patterns is accepted | |
- `excludeRoutes`: List of routes to exclude from Reload automatically injecting its script onto. | |
- Default: *[Array]* with no items in it. This means Reload will inject its script on all routes by default. |
@@ -372,10 +372,13 @@ Resolves to: | |||
{ | |||
"enable": true, | |||
"port": 9856, | |||
"httpsPort": 9857 | |||
"httpsPort": 9857, | |||
"excludeRoutes": [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The HTML minifier has a similar param called exceptionRoutes
, either this new one, or the old one should be renamed for consistency.
Added the ability to exclude frontend reload script injection via glob patterns at the server configuration level.
(Closes #1150)