babel-plugin-transform-relative-paths

Transform relative paths with babel

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
babel-plugin-transform-relative-paths
0.1.05 years ago5 years agoMinified + gzip package size for babel-plugin-transform-relative-paths in KB

Readme

babel-plugin-transform-relative-paths
Transform relative paths with babel
Transforms relative paths up one level by default:
// input
import someModule from './a-relative-path'
import someOtherModule from '../a-relative-path'
const someCommonModule = require('../../a-relative-path')

// output
import someModule from '../a-relative-path'
import someOtherModule from '../../a-relative-path'
const someCommonModule = require('../../../a-relative-path')

Usage

npm install --save-dev babel-plugin-transform-relative-paths

Specify the plugin in your .babelrc. Here's an example:
{
  "plugins": ["transform-relative-paths"]
}