0.0.1 • Published 5 years ago
absolute-path.macro v0.0.1
absolute-path.macro
A Babel macro to convert relative paths to absolute paths
Usage
First, configure babel-plugin-macros
.
Then, use absolute-path.macro
as follows:
const {absolutePath} = require('absolute-path.macro')
console.log(absolutePath`foo`)
The above code will compile into:
console.log(`/path/to/foo`)
(Where /path/to/foo
is the absolute path to foo
.)
Installation
$ yarn add --dev absolute-path.macro
License
0.0.1
5 years ago