FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix detection of parent directory in ModuleScopePlugin by diligiant · Pull Request #2405 · react/create-react-app · GitHub

Fix detection of parent directory in ModuleScopePlugin - #2405

Merged
gaearon merged 2 commits into
react:masterfrom
diligiant:master
May 29, 2017
Merged

Fix detection of parent directory in ModuleScopePlugin#2405
gaearon merged 2 commits into
react:masterfrom
diligiant:master

Conversation

Copy link
Copy Markdown

This PR fixes #2404.

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact cla@fb.com if you have any questions.

Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

Timer commented May 29, 2017

Copy link
Copy Markdown
Contributor

LGTM, can you show me a sample path of this though? Curious to see the problem as I'm not really visualizing it too well.

diligiant commented May 29, 2017
edited
Loading

Copy link
Copy Markdown
Author

Of course.

Module not found: You attempted to import /root_path_replaced_here/website/src/.tmp-globalize-webpack/dev-i18n-data.js which falls outside of the project src/ directory. Relative imports outside of src/ are not supported. You can either move it inside src/, or add a symlink to it from project's node_modules/.

Timer commented May 29, 2017

Copy link
Copy Markdown
Contributor

Oh okay, I didn't realize a webpack plugin would dirty your src directory. Makes perfect sense now, thanks! :)

Copy link
Copy Markdown
Author

I'm not expert enough to confirm nor deny your assertion ;)

);
// Error if in a parent directory of src/
if (requestRelative[0] === '.') {
if (requestRelative.startsWith('../')) {

Timer May 29, 2017
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This should probably use path.sep instead of / for cross platform reasons. 😄
You could also be explicit and just add a second case for \.


Should we change the check above, too? I'm not sure if people use dot directories often.

diligiant May 29, 2017
edited
Loading

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thank you for the windows "reminder"! I added a second case to match the style above in the code.
I also fixed the first detection (different situation though).

Timer left a comment
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I don't believe this will work on Windows machines. Please see my comment.

Timer added this to the 1.0.8 milestone May 29, 2017
Add windows specific path and extend to issuer path

Timer commented May 29, 2017

Copy link
Copy Markdown
Contributor

Great, thanks!

gaearon merged commit bcf398d into react:master May 29, 2017
zangrafx added a commit to zangrafx/create-react-app that referenced this pull request May 31, 2017
* master:
  Add WebStorm >2017 launchEditor Support (react#2414)
  docs: update `jest-enzyme` section (react#2392)
  Fix detection of parent directory in ModuleScopePlugin (react#2405)
  Added cache clear to e2e scripts (react#2400)
  Fix kill command in e2e-kitchensink.sh cleanup (react#2397)
  Revert "Catch "No tests found" during CI" (react#2390)
  Fix wrong path expansion in end-to-end test (react#2388)
  Suggest just "yarn build" (react#2385)
  Catch "No tests found" during CI (react#2387)
  Publish
  Add changelog for 1.0.7 (react#2384)
  Update webpack to 2.6.1 (react#2383)
  Consistently set environment variables (react#2382)
  Disable comparisons feature in uglify compression in production (react#2379)
  Removed the overriding of reduce_vars to false since webpack v2.6.0 included the fixed for Uglify bug (react#2351)
gaearon mentioned this pull request Jun 28, 2017
romaindso pushed a commit to romaindso/create-react-app that referenced this pull request Jul 10, 2017
* Fix detection of parent directory

* Correct parent directory detection fix

Add windows specific path and extend to issuer path
wmonk referenced this pull request in wmonk/create-react-app-typescript Aug 7, 2017
* Fix detection of parent directory

* Correct parent directory detection fix

Add windows specific path and extend to issuer path
lock Bot locked and limited conversation to collaborators Jan 21, 2019
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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ModuleScopePlugin can't deal with dot directories

4 participants


Back | FazBrowse Home | New Git URL