1.0.6 • Published 6 years ago

babel-plugin-import-transform v1.0.6

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

Babel plugin to transform import and require path to relative or absolute

Example

import Library from 'library'

transform alias to relative path

import Library from '../library'

Install

npm install bable-plugin-import-transform --save-dev

Use

Add it to your plugins array in your babel config .babelrc file.

{
 "plugins": [
   [
     "babel-plugin-import-transform",{
       "core/**": 'transform.js'
     }
   ]
 ]
}

transform.js in project root

module.exports = function(importName, compileFile) {
 return "../" + importName + "path" 
}

Regular

use micromatch as regular match "core/**"

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago