lundi 27 juillet 2015

How do I avoid going up the directory tree when importing dependencies

I have a project directory tree with the source and test directories side by side.

project
  - src
    - paths to modules
  - test
    - identical paths to above modules

How do I avoid climbing the directory tree like this:

// characters.spec.js
import { stewie } from '../../src/family-guy/characters';

Ideally I would like path to be what it is from inside the module itself:

// characters.js
import { stewie } from './family-guy/season/characters';

Aucun commentaire:

Enregistrer un commentaire