1.0.2 • Published 5 years ago

babel-resolve-relative-module v1.0.2

Weekly downloads
127
License
ISC
Repository
github
Last release
5 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

5 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.1

9 years ago