1.0.2 • Published 6 years ago

babel-resolve-relative-module v1.0.2

Weekly downloads
127
License
ISC
Repository
github
Last release
6 years ago

This module provides an implementation of the Babel module resolver function which transforms paths relative to a root directory into relative paths that will be understood by Node's require function or by Browserify.

import MasterView from '../../MasterView'

can be converted to

import MasterView from 'app/components/MasterView'

This gives consistent paths and does not require calculating the path relative to the file where the module is imported.

Use

In your Babel config:

import resolveRelativeModule from 'babel-resolve-relative-module'

const babelConfig = {
	resolveModuleSource: resolveRelativeModule('./src/app')
}

Modules can now be imported relative to ./src/app

Install

npm install babel-resolve-relative-module
1.0.2

6 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.1

10 years ago