I have presets for all the parts in the tool-chain, from Jest to TSLint. Then I did the same for Babel.
The preset works perfectly, if the name is "babel-preset-xxx", but we prefix all our react stuff then the package become "@company/rdk.babel-preset-xxx".
Now if I try to use it in webpack as:
{
loader: 'babel-loader',
options: {
presets: ['@company/rdk.babel-preset-xxx'],
},
},
THIS BREAKS :( ... with this message:
Error: Cannot find module '@company/babel-preset-rdk.babel-preset-xxx' from ...
- If you want to resolve "@company/rdk.babel-preset-xxx", use "module:@company/rdk.babel-preset-xxx"
As the hint says, prefixing with module: works. But also just suffixing with /. I mean, both options works:
presets: ['module:@company/rdk.babel-preset-xxx'] and/or presets: ['@company/rdk.babel-preset-xxx/']
Is this documented in some place? Could be possible scoped packages different than @babel/ to be resolved using node resolution before Babel's resolution ?
I have
presetsfor all the parts in the tool-chain, from Jest to TSLint. Then I did the same for Babel.The preset works perfectly, if the name is "babel-preset-xxx", but we prefix all our react stuff then the package become "@company/rdk.babel-preset-xxx".
Now if I try to use it in webpack as:
THIS BREAKS :( ... with this message:
As the hint says, prefixing with
module:works. But also just suffixing with/. I mean, both options works:presets: ['module:@company/rdk.babel-preset-xxx']and/orpresets: ['@company/rdk.babel-preset-xxx/']Is this documented in some place? Could be possible scoped packages different than
@babel/to be resolved using node resolution before Babel's resolution ?