145 lines
10 KiB
JSON
145 lines
10 KiB
JSON
{
|
|
"_args": [
|
|
[
|
|
{
|
|
"raw": "babel-plugin-module-resolver@^2.7.1",
|
|
"scope": null,
|
|
"escapedName": "babel-plugin-module-resolver",
|
|
"name": "babel-plugin-module-resolver",
|
|
"rawSpec": "^2.7.1",
|
|
"spec": ">=2.7.1 <3.0.0",
|
|
"type": "range"
|
|
},
|
|
"/home/jdaugherty/work/GT2/GT2-Android/node_modules/babel-preset-expo"
|
|
]
|
|
],
|
|
"_from": "babel-plugin-module-resolver@>=2.7.1 <3.0.0",
|
|
"_id": "babel-plugin-module-resolver@2.7.1",
|
|
"_inCache": true,
|
|
"_location": "/babel-plugin-module-resolver",
|
|
"_nodeVersion": "7.10.0",
|
|
"_npmOperationalInternal": {
|
|
"host": "packages-12-west.internal.npmjs.com",
|
|
"tmp": "tmp/babel-plugin-module-resolver-2.7.1.tgz_1494973334469_0.11379158054478467"
|
|
},
|
|
"_npmUser": {
|
|
"name": "tleunen",
|
|
"email": "tommy.leunen@gmail.com"
|
|
},
|
|
"_npmVersion": "4.6.1",
|
|
"_phantomChildren": {
|
|
"fs.realpath": "1.0.0",
|
|
"inflight": "1.0.6",
|
|
"inherits": "2.0.3",
|
|
"minimatch": "3.0.4",
|
|
"once": "1.4.0",
|
|
"path-is-absolute": "1.0.1"
|
|
},
|
|
"_requested": {
|
|
"raw": "babel-plugin-module-resolver@^2.7.1",
|
|
"scope": null,
|
|
"escapedName": "babel-plugin-module-resolver",
|
|
"name": "babel-plugin-module-resolver",
|
|
"rawSpec": "^2.7.1",
|
|
"spec": ">=2.7.1 <3.0.0",
|
|
"type": "range"
|
|
},
|
|
"_requiredBy": [
|
|
"/babel-preset-expo"
|
|
],
|
|
"_resolved": "https://registry.npmjs.org/babel-plugin-module-resolver/-/babel-plugin-module-resolver-2.7.1.tgz",
|
|
"_shasum": "18be3c42ddf59f7a456c9e0512cd91394f6e4be1",
|
|
"_shrinkwrap": null,
|
|
"_spec": "babel-plugin-module-resolver@^2.7.1",
|
|
"_where": "/home/jdaugherty/work/GT2/GT2-Android/node_modules/babel-preset-expo",
|
|
"author": {
|
|
"name": "Tommy Leunen",
|
|
"email": "tommy.leunen@gmail.com",
|
|
"url": "http://tommyleunen.com"
|
|
},
|
|
"bugs": {
|
|
"url": "https://github.com/tleunen/babel-plugin-module-resolver/issues"
|
|
},
|
|
"dependencies": {
|
|
"find-babel-config": "^1.0.1",
|
|
"glob": "^7.1.1",
|
|
"resolve": "^1.2.0"
|
|
},
|
|
"description": "Module resolver plugin for Babel",
|
|
"devDependencies": {
|
|
"babel-cli": "^6.22.2",
|
|
"babel-core": "^6.22.1",
|
|
"babel-jest": "^18.0.0",
|
|
"babel-plugin-transform-object-rest-spread": "^6.22.0",
|
|
"babel-preset-latest": "^6.22.0",
|
|
"eslint": "^3.15.0",
|
|
"eslint-config-airbnb-base": "^11.0.1",
|
|
"eslint-plugin-import": "^2.2.0",
|
|
"jest": "^18.1.0",
|
|
"standard-version": "^4.0.0"
|
|
},
|
|
"directories": {},
|
|
"dist": {
|
|
"shasum": "18be3c42ddf59f7a456c9e0512cd91394f6e4be1",
|
|
"tarball": "https://registry.npmjs.org/babel-plugin-module-resolver/-/babel-plugin-module-resolver-2.7.1.tgz"
|
|
},
|
|
"files": [
|
|
"lib"
|
|
],
|
|
"gitHead": "dc8849d6d25b451c1ed72ab9c231d15b057f6cf4",
|
|
"greenkeeper": {
|
|
"ignore": [
|
|
"babel-jest",
|
|
"eslint",
|
|
"eslint-plugin-import"
|
|
]
|
|
},
|
|
"homepage": "https://github.com/tleunen/babel-plugin-module-resolver#readme",
|
|
"jest": {
|
|
"testRegex": "/test/.*\\.test\\.js$",
|
|
"collectCoverageFrom": [
|
|
"src/**/*.js"
|
|
]
|
|
},
|
|
"keywords": [
|
|
"babel",
|
|
"babel-plugin",
|
|
"module",
|
|
"resolver",
|
|
"alias",
|
|
"rewrite",
|
|
"resolve",
|
|
"rename",
|
|
"mapping",
|
|
"require",
|
|
"import"
|
|
],
|
|
"license": "MIT",
|
|
"main": "lib/index.js",
|
|
"maintainers": [
|
|
{
|
|
"name": "tleunen",
|
|
"email": "tommy.leunen@gmail.com"
|
|
}
|
|
],
|
|
"name": "babel-plugin-module-resolver",
|
|
"optionalDependencies": {},
|
|
"readme": "# babel-plugin-module-resolver\n[![Maintenance Status][status-image]][status-url] [![NPM version][npm-image]][npm-url] [![Build Status Linux][circleci-image]][circleci-url] [![Build Status Windows][appveyor-image]][appveyor-url] [![Coverage Status][coverage-image]][coverage-url]\n\nA [babel](http://babeljs.io) plugin to add a new resolver for your modules when compiling your code using Babel. The plugin allows you to add new \"root\" directories that contains your modules. It also allows you to setup custom alias which can also be directories or specific files, or even other npm modules.\n\n## Description\n\nThe reason of this plugin is to simplify the require/import paths in your project. Therefore, instead of using complex relative paths like `../../../../utils/my-utils`, you would be able to write `utils/my-utils`. It will allow you to work faster since you won't need to calculate how many levels of directory you have to go up before accessing the file.\n\n```js\n// Use this:\nimport MyUtilFn from 'utils/MyUtilFn';\n// Instead of that:\nimport MyUtilFn from '../../../../utils/MyUtilFn';\n\n// And it also work with require calls\n// Use this:\nconst MyUtilFn = require('utils/MyUtilFn');\n// Instead of that:\nconst MyUtilFn = require('../../../../utils/MyUtilFn');\n```\n\n## Usage\n\nIf you're coming from babel-plugin-module-alias, please read this section: Updating from [babel-plugin-module-alias](#updating-from-babel-plugin-module-alias).\n\nInstall the plugin\n\n```\n$ npm install --save-dev babel-plugin-module-resolver\n```\n\nSpecify the plugin in your `.babelrc` with the custom root or alias. Here's an example:\n```json\n{\n \"plugins\": [\n [\"module-resolver\", {\n \"root\": [\"./src\"],\n \"alias\": {\n \"test\": \"./test\",\n \"underscore\": \"lodash\"\n }\n }]\n ]\n}\n```\n\n### Options\n\n- `root`: Array of root directories. Specify the paths or a glob path (eg. `./src/**/components`)\n- `alias`: Map of alias. You can also alias node_modules dependencies, not just local files.\n- `extensions`: Array of extensions used in the resolver. Override the default extensions (`['.js', '.jsx', '.es', '.es6']`).\n- `cwd`: By default, the working directory is the one used for the resolver, but you can override it for your project.\n - The custom value `babelrc` will make the plugin look for the closest babelrc configuration based on the file to parse.\n\n### Updating from babel-plugin-module-alias\n\nbabel-plugin-module-resolver is a new version of the old babel-plugin-module-alias. Therefore, you also need to make a few modifications to your plugin configuration to make it work with this new plugin.\n\nUpdating is very easy, so for example if you had this configuration:\n```json\n// This configuration is outdated, this is just an example\n{\n \"plugins\": [\n [\"module-alias\", [\n { \"src\": \"./src/utils\", \"expose\": \"utils\" },\n { \"src\": \"./src/components\", \"expose\": \"components\" },\n { \"src\": \"./src/actions\", \"expose\": \"actions\" },\n { \"src\": \"npm:lodash\", \"expose\": \"underscore\" }\n ]]\n ]\n}\n```\nYou ony have to update the plugin options to be like this:\n```json\n{\n \"plugins\": [\n [\"module-resolver\", {\n \"root\": [\"./src\"],\n \"alias\": {\n \"underscore\": \"lodash\"\n }\n }]\n ]\n}\n```\n\n## ESLint plugin\n\nIf you're using ESLint, you should use the [eslint-plugin-import][eslint-plugin-import], and this [eslint-import-resolver-babel-module][eslint-import-resolver-babel-module] in order to remove falsy unresolved modules.\n\n## Editors autocompletion\n\n- Atom: Uses [atom-autocomplete-modules][atom-autocomplete-modules] and enable the `babel-plugin-module-resolver` option.\n- IntelliJ/WebStorm: You can add custom resources root directories, make sure it matches what you have in this plugin.\n\n## License\n\nMIT, see [LICENSE.md](/LICENSE.md) for details.\n\n\n[status-image]: https://img.shields.io/badge/status-maintained-brightgreen.svg\n[status-url]: https://github.com/tleunen/babel-plugin-module-resolver\n\n[npm-image]: https://img.shields.io/npm/v/babel-plugin-module-resolver.svg\n[npm-url]: https://www.npmjs.com/package/babel-plugin-module-resolver\n\n[circleci-image]: https://img.shields.io/circleci/project/tleunen/babel-plugin-module-resolver/master.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSItMTQyLjUgLTE0Mi41IDI4NSAyODUiPjxjaXJjbGUgcj0iMTQxLjciIGZpbGw9IiNERDQ4MTQiLz48ZyBpZD0iYSIgZmlsbD0iI0ZGRiI%2BPGNpcmNsZSBjeD0iLTk2LjQiIHI9IjE4LjkiLz48cGF0aCBkPSJNLTQ1LjYgNjguNGMtMTYuNi0xMS0yOS0yOC0zNC00Ny44IDYtNSA5LjgtMTIuMyA5LjgtMjAuNnMtMy44LTE1LjctOS44LTIwLjZjNS0xOS44IDE3LjQtMzYuNyAzNC00Ny44bDEzLjggMjMuMkMtNDYtMzUuMi01NS4zLTE4LjctNTUuMyAwYzAgMTguNyA5LjMgMzUuMiAyMy41IDQ1LjJ6Ii8%2BPC9nPjx1c2UgeGxpbms6aHJlZj0iI2EiIHRyYW5zZm9ybT0icm90YXRlKDEyMCkiLz48dXNlIHhsaW5rOmhyZWY9IiNhIiB0cmFuc2Zvcm09InJvdGF0ZSgyNDApIi8%2BPC9zdmc%2B\n[circleci-url]: https://circleci.com/gh/tleunen/babel-plugin-module-resolver\n\n[appveyor-image]: https://img.shields.io/appveyor/ci/tleunen/babel-plugin-module-resolver/master.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjEyOCIgaGVpZ2h0PSIxMjgiIHZpZXdCb3g9IjAgMCAxMjggMTI4Ij48ZyBmaWxsPSIjMUJBMUUyIiB0cmFuc2Zvcm09InNjYWxlKDgpIj48cGF0aCBkPSJNMCAyLjI2NWw2LjUzOS0uODg4LjAwMyA2LjI4OC02LjUzNi4wMzd6Ii8%2BPHBhdGggZD0iTTYuNTM2IDguMzlsLjAwNSA2LjI5My02LjUzNi0uODk2di01LjQ0eiIvPjxwYXRoIGQ9Ik03LjMyOCAxLjI2MWw4LjY3LTEuMjYxdjcuNTg1bC04LjY3LjA2OXoiLz48cGF0aCBkPSJNMTYgOC40NDlsLS4wMDIgNy41NTEtOC42Ny0xLjIyLS4wMTItNi4zNDV6Ii8%2BPC9nPjwvc3ZnPg==\n[appveyor-url]: https://ci.appveyor.com/project/tleunen/babel-plugin-module-resolver\n\n[coverage-image]: https://codecov.io/gh/tleunen/babel-plugin-module-resolver/branch/master/graph/badge.svg\n[coverage-url]: https://codecov.io/gh/tleunen/babel-plugin-module-resolver\n\n[eslint-import-resolver-babel-module]: https://github.com/tleunen/eslint-import-resolver-babel-module\n[eslint-plugin-import]: https://github.com/benmosher/eslint-plugin-import\n[atom-autocomplete-modules]: https://github.com/nkt/atom-autocomplete-modules\n",
|
|
"readmeFilename": "README.md",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/tleunen/babel-plugin-module-resolver.git"
|
|
},
|
|
"scripts": {
|
|
"compile": "babel src --out-dir lib",
|
|
"lint": "eslint src test",
|
|
"prepublish": "npm run compile",
|
|
"pretest": "npm run lint",
|
|
"release": "standard-version",
|
|
"test": "jest --coverage",
|
|
"test:suite": "jest",
|
|
"test:watch": "jest --watch"
|
|
},
|
|
"version": "2.7.1"
|
|
}
|