paths.macro
Advanced tools
Comparing version 1.0.1 to 2.0.0
@@ -6,5 +6,6 @@ const path = require('path'); | ||
const { createMacro } = require('babel-macros'); | ||
const { toUnix } = require('upath'); | ||
const getPaths = f => { | ||
const _fileAbsolute = path.resolve(f); | ||
const _fileAbsolute = toUnix(path.resolve(f)); | ||
const _file = path.basename(_fileAbsolute); | ||
@@ -17,3 +18,3 @@ const _extention = path.extname(_fileAbsolute) | ||
const _gitRoot = findRootAttempt(_fileAbsolute, (dir) => fs.existsSync(path.resolve(dir, '.git'))); | ||
const _wd = process.cwd(); | ||
const _wd = toUnix(process.cwd()); | ||
@@ -20,0 +21,0 @@ const _baseAbsolute = _fileAbsolute.replace(_file, ''); |
{ | ||
"name": "paths.macro", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"description": "Babel plugin that returns an object containing paths like __dirname and __filename as static values", | ||
@@ -32,3 +32,4 @@ "keywords": [ | ||
"babel-plugin-macros": "^2.0.0", | ||
"find-root": "^1.1.0" | ||
"find-root": "^1.1.0", | ||
"upath": "^1.0.2" | ||
}, | ||
@@ -35,0 +36,0 @@ "devDependencies": { |
@@ -1,4 +0,4 @@ | ||
# babel-plugin-paths | ||
# Babel paths.macro | ||
Babel macro that allows you to "import" the location of the source-file. | ||
A [babel macro](https://github.com/kentcdodds/babel-plugin-macros) that allows you to "import" the location of the source-file. | ||
@@ -5,0 +5,0 @@ The supported paths you can import: |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
98898
64
4
+ Addedupath@^1.0.2
+ Addedupath@1.2.0(transitive)