question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change the shorthands from babel-plugin-… to @babel/plugin-…

See original GitHub issue

https://babeljs.io/docs/en/plugins#plugin-shorthand says:

If the name of the package is prefixed with babel-plugin-, you can use a shorthand: … (skip this prefix)

https://babeljs.io/docs/en/presets#preset-shorthand says:

If the name of the package is prefixed with babel-preset-, you can use a shorthand: (skip this prefix)

As plugins and presets are commonly not prefixed with babel-plugin- or babel-preset-, but with @babel/plugin- and @babel/preset- change the shorthand options to @babel/preset- and @babel/plugin-.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
JLHwungcommented, May 12, 2020

I think we can list both @babel/plugin and babel-plugin as supported prefixes because

  1. @babel/core supports both of them
  2. Conventionally community plugins that are not hosted in babel repo start with babel-plugin-: e.g. babel-plugin-istanbul, babel-plugin-dynamic-import-node and a few others to name.
0reactions
hzoocommented, Apr 2, 2021

Not sure if behavior changed but testing babel-cli --presets='typescript' (preset should be presets) will give the error

Did you mean “@babel/typescript”?

which is expected since you need the org @babel part assuming @babel/preset-typescript was installed

But the example may be confusing if you are using Babel’s presets vs one on npm so we can change that

Read more comments on GitHub >

github_iconTop Results From Across the Web

babel/plugin-transform-shorthand-properties
Installation. npm install --save-dev @babel/plugin-transform-shorthand-properties. Copy. Usage. With a configuration file (Recommended).
Read more >
@babel/plugin-transform-shorthand-properties - npm
Start using @babel/plugin-transform-shorthand-properties in your project by running `npm i @babel/plugin-transform-shorthand-properties`.
Read more >
@babel/plugin-transform-shorthand-properties | Yarn - Yarn
Fast, reliable, and secure dependency management.
Read more >
Babel - Storybook
Babel. Storybook's webpack config by default sets up Babel for ES6 transpiling. It has three different modes: CRA - the mode for Create...
Read more >
Migrating from Babel - SWC
Comparison ; babel-plugin-transform-runtime, ✔️ ; babel-plugin-transform-shorthand-properties, ✔️ ; babel-plugin-transform-spread, ✔️ ; babel- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found