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

Work with Rollup

Open egoist opened this issue 7 years ago • 1 comments

Given following config:

["module-resolver", {
  "root": ".",
  "alias": {
    "@": "."
  }
}]

And sample code:

import main from '@/src/index'

This will be transformed to:

import main from './src'

Which would not work in Rollup, it has to be ./src/index

egoist avatar Apr 04 '18 09:04 egoist

Why would it need to be /index? index.js is the default file loaded in a directory

tleunen avatar Apr 05 '18 12:04 tleunen