This repository was archived by the owner on Mar 17, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 256
feat: add context to options.outputPath
&& options.publicPath
#166
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The context includes three fields userRequest, rawRequest and issuer context.
options.outputPath
&& options.publicPath
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.
Please add a test :)
bebraw
reviewed
Jun 6, 2017
index.js
Outdated
@@ -50,9 +50,12 @@ module.exports = function(content) { | |||
url = relativePath + url; | |||
} else if (config.outputPath) { | |||
// support functions as outputPath to generate them dynamically | |||
var userRequest = this._module && this._module.userRequest |
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.
It would be neater to do
var module = this._module || {};
var userRequest = module.userRequest;
...
@coot Do you have any good idea to test this, especially things like |
@michael-ciniawsky I added a simple test that checks that a second argument was passed to the |
Close in favor #166. I think better pass |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The context includes three fields userRequest, rawRequest and issuer context.
What kind of change does this PR introduce?
Adds functionality to outputPath and publicPath options (when set to functions)
Did you add tests for your changes?
Yes.
If relevant, did you update the README?
No, not yet, waiting for comments.
Summary
I am working on an react app in which I need to have relative path for files. The static assets are served from
./static
folder. When the app is requesting images there are two cases:Does this PR introduce a breaking change?
No.
Other information