-
Notifications
You must be signed in to change notification settings - Fork 920
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
support custom web modules dir #483
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -357,9 +357,13 @@ function normalizeScripts(cwd: string, scripts: RawScripts): BuildScript[] { | |
} | ||
let dirDisk = cmdArr[0]; | ||
const dirUrl = to || `/${cmdArr[0]}`; | ||
|
||
// mount:web_modules is a special case script where the fromDisk | ||
// arg is harcoded to match the internal dependency dir | ||
if (scriptId === 'mount:web_modules') { | ||
dirDisk = dependenciesLoc; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: I know the code that was here before was a little confusing (at least to me), and you changed as little as possible. But with this addition do you think you could add a comment or two to explain what this section is doing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes! Hadn't seen too many existing comments in the |
||
|
||
newScriptConfig.args = { | ||
fromDisk: path.posix.normalize(dirDisk + '/'), | ||
toUrl: path.posix.normalize(dirUrl + '/'), | ||
|
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.
@FredKSchott What do you think about doing this instead?
That would make the Script Variables section of the docs more accurate and technically it'd be a little bit more flexible. Not sure that anyone needs/wants that flexibility though.
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.
+1, I think that's a good idea. Feel free to tackle in a future PR