Babel extensions

720 views Asked by At

How do I specify different extensions for babel to revolve, like webpack's resolve.extensions? I want to use .web.js in my browser build and (something like) .server.js for my node server files, so that this:

import foo from './foo';

Will import the right file. I know about babel-cli/babel-node ---extensions and that has babel determine if it will transpile a file after it's already been resolved. I want an option (ideally in . babelrc or cli args) for resolving.

0

There are 0 answers