-
Notifications
You must be signed in to change notification settings - Fork 87
rollup-plugin-babel cannot read .babelrc when run from repo root #271
Comments
OK, repro is at |
This is in fact strange and I'm not sure why this happens, however rollup-plugin-babel doesn't load babelrc files on it own - that's babel responsibility, so the issue got kinda reported in the wrong repository. You can "fix it" by passing cc @loganfsmyth |
The core of it is that we use the working directory as the default for the Probably worth reading through https://babeljs.io/docs/en/config-files though if you have suggestions for improvements, I'm happy to hear them. Realistically, we should have a section specifically about configuring monorepos. The critical part from there in this context is
|
Thanks for taking a look, @Andarist. I think you're right, this is a babel issue. Sorry for filing in the wrong repo. Thanks for your comment, @loganfsmyth. I read through those docs earlier today, but this part doesn't seem accurate:
If that were true, wouldn't the settings in a For example, in the sample repo I provided the file being compiled is Maybe it's worth mentioning how the current working directory affects the lookup of Thanks again for taking a look. |
No problem at all. I definitely agree with @mjackson that current docs around this are misleading - I was reading them while investigating this and couldnt figure out from them what's the exact reason why this babelrc wasnt picked up. I just knew from other issues reported previously how to fix it (with babelrcRoots) but it was unclear for me why it has to be specified in this case. |
Yeah you are right that that passage is overly broad. It should probably have a |
Well, it looks like this was just a misunderstanding of the way I believed the |
When I run babel-cli it works fine - .babelrc or babel.config.js. with rollup it's not picking up either |
@ntucker could u provide a repository with the issue reproduced? |
@Andarist Turns out I was missing the extensions: ['.js', '.ts'] on babel options so babel was just skipping my .ts files due to that. |
- [npm start] remove typescript declaration file - [npm start] use babel with typescript preset - [npm build] use typescript compiler references: - rollup/rollup-plugin-babel#255 - rollup/rollup-plugin-typescript#129 - rollup/rollup-plugin-babel#271 - rollup/rollup-plugin-babel#279 - microsoft/TypeScript-Babel-Starter#29
It seems like
rollup-plugin-babel
only finds and reads.babelrc
files when it is run outside the directory where that package is contained. I am going to post a repro here shortly.Possibly related to #232, but I'm not sure because the source repo has since been deleted.
The text was updated successfully, but these errors were encountered: