Open
Description
I would like to embed babel using source version (github.com/babel
) instead of packaged version (npm @babel/*
) in order to benefits of a better (webpack) tree-shaking (@babel/*
is cjs whereas github.com/babel
is mjs/ts) and to reduce final bundle size.
I need to make TypeScript to resolve any node_modules/@babel/*
to node_modules/babel/packages/babel-*/src
I tried with compilerOptions.paths
with no success :
paths: {
'@babel/code-frame': ['babel/packages/babel-code-frame/src'],
}
Is there a trick to make any require to @babel/*
to point to babel/packages/babel-*/src
?
BTW, In the webpack configuration file, I use:
resolve: {
alias: {
'@babel/code-frame': 'babel/backages/babel-code-frame/src',
and I'm looking for the equivalent for typescript.
Metadata
Metadata
Assignees
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
Toilal commentedon Mar 9, 2021
I think aliases should also be defined in tsconfig in this case.
https://dev.to/larswaechter/path-aliases-with-typescript-in-nodejs-4353
I'm not sure this kink of wildcard expression is supported though ...
FranckFreiburger commentedon Apr 5, 2021
related stackoverflow question
nicolo-ribaudo commentedon Sep 9, 2024
Hey, Babel maintainer here.
You could considering using Babel 8.0.0 (which is still in alpha, but we'll release a beta soon), which is published as ESM.