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

Revisit .babelrc.js #31007

Closed
XhmikosR opened this issue Jun 10, 2020 · 2 comments · Fixed by #31011
Closed

Revisit .babelrc.js #31007

XhmikosR opened this issue Jun 10, 2020 · 2 comments · Fixed by #31011
Labels

Comments

@XhmikosR
Copy link
Member

Not sure what was the reason behind using @babel/plugin-proposal-object-rest-spread; spread seem to be transpiled even without the extra plugin.

Also, exclude: ['transform-typeof-symbol'] does not seem to apply in our codebase.

Any hints welcome.

@XhmikosR XhmikosR added the js label Jun 10, 2020
@razh
Copy link
Contributor

razh commented Jun 11, 2020

@XhmikosR
Copy link
Member Author

XhmikosR commented Jun 11, 2020

Thanks for the reply!

It doesn't seem that the transpiled spread code is 100% the same though. It seems without @babel/plugin-proposal-object-rest-spread in plugins, babel is extending Object.assign. https://babeljs.io/docs/en/babel-plugin-proposal-object-rest-spread#loose

Not sure if there is any issue.

EDIT: here's what seems to be identical to what we have

  1. remove @babel/plugin-proposal-object-rest-spread from package.json devDependencies since it's included in @babel/preset-env
  2. use this config:
module.exports = {
  presets: [
    [
      '@babel/preset-env',
      {
        loose: true,
        modules: false
      }
    ]
  ],
  plugins: [
    '@babel/plugin-proposal-object-rest-spread'
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants