{"_id":"@afzalimdad9/babel-plugin-dot-dot-slash","name":"@afzalimdad9/babel-plugin-dot-dot-slash","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@afzalimdad9/babel-plugin-dot-dot-slash","version":"1.0.0","description":"Babel plugin to solve the '../../../' problem.","author":{"name":"Afzal Imdad","email":"afzalimdad9@gmail.com","url":"http://github.com/afzalimdad9"},"license":"MIT","main":"./dist/index.js","repository":{"type":"git","url":"git+https://github.com/afzalimdad9/babel-plugin-dot-dot-slash.git"},"keywords":["babel","babel-plugin","import","relative import","afzalimdad9"],"scripts":{"test":"ava --no-cache","build":"babel ./index.js --out-dir ./dist"},"ava":{"files":["tests/**/*.test.js"],"require":["babel-register"],"babel":"inherit"},"devDependencies":{"ava":"^6.2.0","babel-cli":"^6.26.0","babel-core":"^6.26.3","babel-preset-es2015":"^6.24.1"},"dependencies":{"app-root-path":"^3.1.0","slash":"^5.1.0"},"_id":"@afzalimdad9/babel-plugin-dot-dot-slash@1.0.0","gitHead":"97c300333b9b6b0e66a2885c85ad96c3db6f3b4c","bugs":{"url":"https://github.com/afzalimdad9/babel-plugin-dot-dot-slash/issues"},"homepage":"https://github.com/afzalimdad9/babel-plugin-dot-dot-slash#readme","_nodeVersion":"23.9.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-NNqzz30sIzy7b6xa8ZElon7VVmKRG5AaQ8KqJI5oO0ByJitb301qRAUUM/mwRXPet480X4W+Lm1YPbrPPt0iNA==","shasum":"8a048c0875e3c133d9ea824547f40dfded0da307","tarball":"https://registry.npmjs.org/@afzalimdad9/babel-plugin-dot-dot-slash/-/babel-plugin-dot-dot-slash-1.0.0.tgz","fileCount":9,"unpackedSize":9089,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCb07Afy6KeXa4E42Dw8I57+ml/obu0TGWicqv7I+s/mwIgOr7vRlor1Ice2h5Ohxqp1x4y+LHEza5VblJc1eiAS0U="}]},"_npmUser":{"name":"afzalimdad9","email":"afzalimdad9@gmail.com"},"directories":{},"maintainers":[{"name":"afzalimdad9","email":"afzalimdad9@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/babel-plugin-dot-dot-slash_1.0.0_1741466955858_0.2655107116546316"},"_hasShrinkwrap":false}},"time":{"created":"2025-03-08T20:49:15.771Z","1.0.0":"2025-03-08T20:49:16.062Z","modified":"2025-03-08T20:49:16.365Z"},"maintainers":[{"name":"afzalimdad9","email":"afzalimdad9@gmail.com"}],"description":"Babel plugin to solve the '../../../' problem.","homepage":"https://github.com/afzalimdad9/babel-plugin-dot-dot-slash#readme","keywords":["babel","babel-plugin","import","relative import","afzalimdad9"],"repository":{"type":"git","url":"git+https://github.com/afzalimdad9/babel-plugin-dot-dot-slash.git"},"author":{"name":"Afzal Imdad","email":"afzalimdad9@gmail.com","url":"http://github.com/afzalimdad9"},"bugs":{"url":"https://github.com/afzalimdad9/babel-plugin-dot-dot-slash/issues"},"license":"MIT","readme":"# @afzalimdad9/babel-plugin-dot-dot-slash \n\n> Babel plugin to solve the `../../../` problem.\n\n[![travis build](https://img.shields.io/travis/afzalimdad9/babel-plugin-dot-dot-slash.svg?style=flat-square)](https://travis-ci.org/afzalimdad9/babel-plugin-dot-dot-slash)\n[![version](https://img.shields.io/npm/v/@afzalimdad9/babel-plugin-dot-dot-slash.svg?style=flat-square)](http://npm.im/@afzalimdad9/babel-plugin-dot-dot-slash)\n[![MIT License](https://img.shields.io/npm/l/@afzalimdad9/babel-plugin-dot-dot-slash.svg?style=flat-square)](http://opensource.org/licenses/MIT)\n\n## Example\n```js\n//before\nimport Module from '../../../path/to/module.js'\n\n//after\nimport Module from '+/path/to/module.js'\n```\n\n## Install\n```\nnpm install --save-dev @afzalimdad9/babel-plugin-dot-dot-slash\n```\n\nThen you only need to specify it as a Babel plugin, which you would typically do in your `.babelrc` file:\n```js\n{\n  \"plugins\": [\n    \"dot-dot-slash\"\n  ]\n}\n```\n\n## Config\n### Root suffix\nIf you want to add a root suffix because all your files are in a especific directory, you can set it like this:\n```js\n{\n  \"plugins\": [\n    [\"dot-dot-slash\", {\n      \"rootSuffix\": \"some/suffix\"\n    }]\n  ]\n}\n```\n\n### Custom import prefix\nIf you don't like the `+` syntax you can set your own prefix:\n```js\n{\n  \"plugins\": [\n    [\"dot-dot-slash\", {\n      \"importPrefix\": \"#\"\n    }]\n  ]\n}\n```\n\nThen you can do:\n```js\nimport Module from '#/path/to/module.js'\n```\n### Fallback to absolute path\nBy default, if the `process.cwd()` is not the project root, the plugin will transform the import declaration to a absolute path. \nIt will make the plugin works in cases where the process is started from other directory, like when you are running your tests with [ava](https://github.com/sindresorhus/ava/issues/32) for example.\n\nTo disable it, just set the `fallbackToAbsolute` config to disabled:\n\n```js\n{\n  \"plugins\": [\n    [\"dot-dot-slash\", {\n      \"fallbackToAbsolute\": \"disabled\"\n    }]\n  ]\n}\n```","readmeFilename":"README.md","_rev":"1-225fc7e682a5771ed45e9a11b1f192b5"}