Why is babel failing to resolve plugins/presets? #4433
-
I'm sorry this is going to be a big vague. I'm really confused. This was all just working perfectly, but I installed a I've tried wiping away the package cache and As far as babel itself, its failure seems to be caused by straight up looking in the wrong place. I have |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Self-discussion |
Beta Was this translation helpful? Give feedback.
-
I was configuring babel's plugins and presets through its javascript API, and the cwd option had not been set correctly. The correct code ended up being: // lib/index.js
const result = await babel.transform(file, {
cwd: resolve(__dirname, '..'), // .. escapes from lib
// ...
} |
Beta Was this translation helpful? Give feedback.
I was configuring babel's plugins and presets through its javascript API, and the cwd option had not been set correctly. The correct code ended up being: