Using babelify with new scoped packages
See original GitHub issueToday I installed the new scoped packages of babel, e.g. @babel/core
etc., including the plugins, e.g. @babel/plugin-proposal-pipeline-operator
etc. However, babelify@8
still requires the ‘old’ babel-core
package, AFAICT. I first installed babel-core@6
by accident, which had problems with the new .babelrc
plugin syntax (before it would prefix babel-plugin-
to get the package, I think; now it’d need to add plugin-
between @babel/
and the plugin name).
However, babel-core@7.0.0-beta.3
, the latest I could find, gave the following error instead:
/home/larsw/project_dir/node_modules/babelify/index.js:65
if (!babel.util.canCompile(filename, extensions)) {
^
TypeError: Cannot read property 'canCompile' of undefined
at /home/larsw/project_dir/node_modules/babelify/index.js:65:21
at Babelify (/home/larsw/project_dir/node_modules/babelify/index.js:10:36)
at nr (/home/larsw/project_dir/node_modules/module-deps/index.js:301:23)
at onfile (/home/larsw/project_dir/node_modules/resolve/lib/async.js:56:21)
at onex (/home/larsw/project_dir/node_modules/resolve/lib/async.js:104:32)
at /home/larsw/project_dir/node_modules/resolve/lib/async.js:24:24
at FSReqWrap.oncomplete (fs.js:153:5)
Note: I’m not sure if it’s possible to use babelify with the new scoped packages at all.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:15
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Henry on Twitter: "we're just modifying like every file in the repo ...
Using scoped packages means that you will need to make a one time change of "@babel/env" instead of ... gulp-babel -> @babel/gulp, babelify...
Read more >Consuming ES6 modules in NPM packages Adventures in brine
I think you can already see how useful our new package is going to be. CleverClass is pretty unexceptional, except for the addition...
Read more >babelify transformation on JSX for React element failing
I am new to React.js and trying out some examples. I have the following code in my js file: var React = require('react'); ......
Read more >Babel · The compiler for next generation JavaScript - Babel.js
As of Meteor 1.2, the ecmascript package is installed by default for all new apps. meteor add ecmascript. Copy. npm install --save-dev @babel/register ......
Read more >Getting import/export working ES6 style using Browserify + ...
If you want to use ES6 modules, you'll need Babel/Babelify to convert your ES6 code into ES5, such that Browserify can understand it....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve open PR for this issue: https://github.com/babel/babelify/pull/252
Meanwhile you can replace the package with my package:
And use the new options
babel
to pass your own babel package:Can we get this merged please? Thanks!