absolute-path.macro

0.0.1 • Public • Published

absolute-path.macro npm Version Build Status

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

MIT

Package Sidebar

Install

npm i absolute-path.macro

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

4.27 kB

Total Files

4

Last publish

Collaborators

  • yuanqing