https://github.com/eddyerburgh/babel-plugin-transform-relative-paths
Transform relative paths with babel
https://github.com/eddyerburgh/babel-plugin-transform-relative-paths
Last synced: 6 months ago
JSON representation
Transform relative paths with babel
- Host: GitHub
- URL: https://github.com/eddyerburgh/babel-plugin-transform-relative-paths
- Owner: eddyerburgh
- License: mit
- Created: 2017-11-09T12:38:15.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-09T12:41:21.000Z (over 8 years ago)
- Last Synced: 2024-12-30T04:26:39.867Z (over 1 year ago)
- Language: JavaScript
- Size: 32.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# babel-plugin-transform-relative-paths
Transform relative paths with babel
Transforms relative paths up one level by default:
```js
// 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:
```json
{
"plugins": ["transform-relative-paths"]
}
```