babel-plugin-module-resolver icon indicating copy to clipboard operation
babel-plugin-module-resolver copied to clipboard

Babel register add previus path Cannot find module '../../../../../

Open hieusmiths opened this issue 5 years ago • 2 comments

My project structure.

React-A:

  • server(Server side redering): babel register.
  • config-overide react app: config alias for team at right.

In the server folder i have a file index.js and this it content inside it.

require('@babel/register')({ config preset-react, [ "module-resolver", { "root": ["./"], "extensions": [".jsx", ".js"], "alias": { "@apiService": "./../src/utils/apiService" } } ] });

And when me run server it will throw Cannot find module '../../../../../src/utils/apiService'.

I can't undertand how to it throw the messsage above. React with config-overide working.

Thank you team, maybe by me mistake with this project structure.

hieusmiths avatar May 13 '20 04:05 hieusmiths

Me too

acbde45 avatar Jun 19 '20 09:06 acbde45

Me too

orzhtml avatar Mar 01 '22 06:03 orzhtml