chimi icon indicating copy to clipboard operation
chimi copied to clipboard

Aliases are relative to the project's root directory

Open gillchristian opened this issue 7 years ago • 0 comments

Consider the following files

/my-module
|__ README.md
|__ docs/
|   |__ doc.md
|__ src/
    |__ index.js

This chimi.config.js

module.exports = {
  aliases: {
    'my-module': `./src/`
  }
}

And this snippet in both README.md docs/doc.md:

const myModule = require('my-module')

myModule.foo().bar()

When chimi aliases my-module to ./src and runs the snippets, the one in the README will run ok but the one in docs/doc.md will error because it cannot find .src/.

gillchristian avatar Nov 19 '17 11:11 gillchristian