Skip to content
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

Ability to set useESModules to false #5452

Closed
ivosabev opened this issue Oct 16, 2018 · 8 comments
Closed

Ability to set useESModules to false #5452

ivosabev opened this issue Oct 16, 2018 · 8 comments

Comments

@ivosabev
Copy link

It seems to me that there is no way in which this settings can be set to false? It could not be overwritten in a babel.config.js neither 😞

useESModules: isEnvDevelopment || isEnvProduction,

@Timer
Copy link
Contributor

Timer commented Oct 16, 2018

We can take this as an option. May I ask your use case?

@Pajn
Copy link
Contributor

Pajn commented Oct 19, 2018

I just hit on the same problem.

My use case is that I use a combined build process for everything for which babel-preset-react-app is the base but with additional plugins for things in the node environment. This has worked good previously but when I try to update to the new version I of course get syntax errors on the import syntax.

Being able to disable useESModules would really help me as I then can avoid forking babel-preset-react-app

@ivosabev
Copy link
Author

I have the same use case as @Pajn, I am using the babel-preset-react-app as the babel config for helper libraries and my node servers. It used to work good before version 2.0. I have recently found another problem that is breaking:

absoluteRuntime: absoluteRuntimePath,

When I build my node server it includes absolute paths, which it shouldn't and there is no way to stop this.

I think the best solution would be if we can overwrite those settings, when using the babel-preset-recat-app package as a standalone babel preset. I have opened an issue with Babel about this, but they have not responded yet.

babel/babel#8799

@bugzpodder
Copy link

@ivosabev you can disable runtime path: #5443 (comment)

@stale
Copy link

stale bot commented Nov 19, 2018

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Nov 19, 2018
@Timer
Copy link
Contributor

Timer commented Nov 19, 2018

PR up in #5487

@stale stale bot removed the stale label Nov 19, 2018
@strayiker
Copy link

strayiker commented Dec 5, 2018

Can this option be applied to the env preset?

// Do not transform modules to CJS
modules: false,

This will allow us to transpile the whole CRA application code for ssr needs.
Also, it will be more obvious if useEsModules: false will be guaranty that transpiled code does not contains esm statements.

@Timer
Copy link
Contributor

Timer commented Dec 6, 2018

I don't see why not, send a PR?

@Timer Timer closed this as completed Dec 6, 2018
@lock lock bot locked and limited conversation to collaborators Jan 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants