Homepage
Sign in / Sign up
Go to the profile of wube
wube
May 6, 2016
Build modular application with npm local modules
Arnaud Rinquin
8610

For Babel there’s a plugin: babel-root-import: https://github.com/michaelzoidl/babel-root-import

So you can import modules with project root relative path like:

import Model from '~/src/js/Model';

instead of:

import Model from '../../../Model'
  • Go to the profile of wube

    wube

    • Share
    Go to the profile of wube
    Never miss a story from wube, when you sign up for Medium. Learn more
    Never miss a story from wube