-
Notifications
You must be signed in to change notification settings - Fork 5
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
CodeKit ignores babel.config.js, making transpiling of node_modules impossible #545
Comments
Where are you placing the The current version of CodeKit (3.8.2) should pick up a properly named, properly located |
See https://babeljs.io/docs/en/configuration for details. |
It's at the project root, at the same place where package.json, config.codekit3 and node_modules are. |
New info: Either I was blind or the Babel docs aren't very clear (or both). babel.config.js is NOT identical to .babelrc. The structure is completely different. See the Babel docs : Now, even with the right syntax, CodeKit still ignores the babel.config.js file. But it's good to know that simply renaming .babelrc does not provide a valid babel.config.js. |
Okay, so I think the easiest way to handle this will be to expand the UI options to allow this configuration. I'm doing that now, but I do not see a |
Okay, I think I've resolved this so that custom config files will be honored as long as you put Babel into "I'll manage settings myself" mode in Project Settings, but I can't download your test project to verify because you didn't give me access. |
It specifies which version of Core JS to use for the polyfills that Babel adds automatically with "usage" mode for preset-env. However I cannot for the life of me remember where I saw that, but I think it was something about it using Core JS version 2 by default, and version 3 being preferable for some reason. I'm sorry, I can neither remember nor find what it was exactly. Maybe I got confused with this corejs option which is not for the same component at all.
I'm sorry. I didn't realize the file wasn't public. It should be now. |
Okay, so I've verified that this is fixed in the next release. All you'll need to do is set the |
I've also added the necessary options to do this without a config file: Note: You DO get a lot of "circular dependency" warnings when you compile the project and let babel transpile ALL of |
I was able to eliminate the circular dependency warnings by setting the "excluded items" textField to:
|
You have gone above and beyond! Those in-app options look great. Do they also allow me to use CodeKit's browser list string directly with preset-env? Does CodeKit even gasp directly include preset-env and friends now? PS: God, I read those threads in Babel and that guy sure is stubborn about compiling distributed modules being a terrible practice 🤔 I mean, I don't MAKE the packages. It's my problem if I need to support an antiquated browser. |
Ah, another question. Is it possible to only use CodeKit's in-app settings for the global Babel settings, but still read the various possible .babelrc files in each sub-folder? |
Yes. Check the “.babelrc” files in Project Settings to allow babelrc. CodeKit has always used its target browsers string in preset-env.
…Sent from my iPhone
On Jun 29, 2019, at 04:40, ArianeNubee ***@***.***> wrote:
Ah, another question. Is it possible to only use CodeKit's in-app settings for the global Babel settings, but still read the various possible .babelrc files in each sub-folder?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Quick, short summary:
Since Babel 7, you're supposed to be able to ask Babel to also transpile imported node_modules, by using a babel.config.js file. It doesn't work with the old .babelrc files. CodeKit only checks for .babelrc. It doesn't check for babel.config.js files at all.
Expected results:
Normally, by mentioning empty array "exclude" and "ignore" settings in babel.config.js, you should be able to tell Babel to transpile and polyfill node_modules code, which is by default ignored by the process.
References:
babel/babel-loader#171
https://babeljs.io/docs/en/configuration#babelconfigjs
Actual results:
CodeKit ignores babel.config.js. It only takes .babelrc, where empty exclude and import parameters do NOT affect node_modules. So it's impossible to transpile node_modules right now.
Exact steps to reproduce:
yarn add vanilla-lazyload
){ "presets": [ [ "@babel/preset-env", { "useBuiltIns": "usage", "targets": { "browsers": ">0.2%, last 2 versions, Firefox ESR, not dead, IE >= 11", }, "include": [], "corejs": 3, } ] ], "exclude": [], "ignore": [] }
yarn add corejs@3
yarn add @babel/core
yarn add @babel/preset-env
A link to download a simplified project or file that shows the issue:
https://drive.google.com/open?id=1rncU8HFxluLP3rsDzrQ7CNl-LA6fnqI1
Your configuration (any details about your system that you think might be relevant)
I don't know what would be relevant, but if I missed something, just ask.
The text was updated successfully, but these errors were encountered: