You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I cannot for the life of me figure out how my baberc is instructing babel-plugin-module-resolver to transform require('@backend/config') to require('../../../backend/src/config')!
meaning build's index.js is trying to import essentially ROOT/backend/backend/src/config which is not correct. I want to to import (relative to index.js) ./config by replacing @becp/config with ./config.
The "good example" linked in the README doesn't help: it uses aliases, but it uses aliases that are imported from aliases.js, which does not exist in the repository, so I can't read how the aliases are actually defined!
The text was updated successfully, but these errors were encountered:
I have a project with this structure
I'm using tsconfig paths so that in my code from any subdirectory I can use
@backend/foobar
instead of../../(.....)/foobar
,My babelrc has
I use tsc to type check and transpire to JS, then babel to transform the custom aliases. Or, am trying to.
Say I have in my src directory index.ts and config.ts
index.ts:
tsc transpiles and outputs to
{root}/intermediate/
. There, I haveindex.js:
Exactly as expected.
Now I'm trying to have babel take the contents of
intermediate
and correct the aliases and output tobuild
:build/.../index.js
I cannot for the life of me figure out how my baberc is instructing babel-plugin-module-resolver to transform
require('@backend/config')
torequire('../../../backend/src/config')
!tsc gives me the following structure
and babel results in
Resulting overall structure is
meaning build's index.js is trying to import essentially
ROOT/backend/backend/src/config
which is not correct. I want to to import (relative to index.js)./config
by replacing@becp/config
with./config
.The "good example" linked in the README doesn't help: it uses aliases, but it uses aliases that are imported from
aliases.js
, which does not exist in the repository, so I can't read how the aliases are actually defined!The text was updated successfully, but these errors were encountered: