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

Babel does not output ES5. #8824

Open
nikolovjd opened this Issue Oct 8, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@nikolovjd

nikolovjd commented Oct 8, 2018

Bug Report

Current Behavior
Babel is outputting const. This breaks in older browsers because const is not allowed in strict mode.

Input Code

  • REPL or Repo link if applicable:
const zipCodes = [...]

Expected behavior/code
To output var. The output stays as const zipCodes... (etc)

Babel Configuration (.babelrc, package.json, cli command)

{
  "plugins": ["@babel/plugin-proposal-class-properties"],
  "presets": [["@babel/preset-env", {"targets": "> 0.25%, not dead", "forceAllTransforms": true}], "@babel/preset-react"]
}

Environment

  • Babel version(s): "@babel/core": "^7.1.2",
  • Node/npm version: v10.9.0
  • OS: irrelevant
  • How you are using Babel: babel-loader for webpack

Additional context/Screenshots
Add any other context about the problem here. If applicable, add screenshots to help explain.

@babel-bot

This comment has been minimized.

Show comment
Hide comment
@babel-bot

babel-bot Oct 8, 2018

Collaborator

Hey @nikolovjd! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.

Collaborator

babel-bot commented Oct 8, 2018

Hey @nikolovjd! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.

@nicolo-ribaudo

This comment has been minimized.

Show comment
Hide comment
@nicolo-ribaudo

nicolo-ribaudo Oct 8, 2018

Member

What is your directory structure? Probably Babel isn't picking up your config.

PS. Instead of using targets+forceAllTransforms, you can just use preset-env without options.

Member

nicolo-ribaudo commented Oct 8, 2018

What is your directory structure? Probably Babel isn't picking up your config.

PS. Instead of using targets+forceAllTransforms, you can just use preset-env without options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment