Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Enable custom source file extensions through cli args or rn-cli.config.js #13689
Allow the packager to load files from other compile-to-JS languages without developers having to specify file extensions in
Add an optional
Extensions specified by
Test Plan (required)
Tests for the changes to node-haste are included. I couldn't find any integration tests for
Here is a repo that shows it working: https://github.com/ds300/TestCustomSourceExts
referenced this pull request
Apr 27, 2017
Looks good to me! The "default config" system is a bit of a mess, for example
packager/defaults really is the "base", not overridable defaults. We'll look into fixing that later on. This changeset follows the same way
assetExts had been done so that's good.
@jeanlauliac I'm getting this error after switching to your branch. The cause wasn't obvious from initial inspection.
Your changes look sensible to me otherwise. This is probably related to other changes that have happened in the meantime. I'll try to take a proper look on Sunday evening UK time.
I've been eager to use this for a while and have been kicking the tires a bit.
With this environment everything seems to work great except for source maps -- they are off by a few lines.
@jmfirth I think that's an orthogonal issue. This PR doesn't say anything about how source transformation should happen. And in particular the transformer I wrote for the test repo is extremely simplistic and doesn't compose the tsc source map with the babel one. So if you are using that, the discrepancy you observe makes sense.
@jeanlauliac the issue was obvious after all. There has been a breaking change in handling the
Now the path given to
cc @davidaurelio this seems like a bad design decision to me, since it makes it super awkward to have a config file in a multi-dev project, unless I'm missing something.
But also that's beside the point for this PR. Making the path absolute makes the problem go away, and now I get a new error, but I also get that same error if I run a blank RN project against master, so it is likely to be unrelated.
In other words, I'm happy with your changes @jeanlauliac
before, both config file and
Closing, let's open separate tasks or PRs to address the other issues.
On an unrelated note, I'm disappointed in myself that I didn't properly give you credit for the changeset. Even though I rebased and changed a few things, you provided most of the idea and original code. I will be careful to maintain a correct Authored-by field next time I merge a PR. I regret not doing so.