absolute-path.macro
v0.0.1
Published
A Babel macro to convert relative paths to absolute paths
Downloads
5
Maintainers
Readme
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