{"name":"@rollup/plugin-node-resolve","version":"13.2.0","publishConfig":{"access":"public"},"description":"Locate and bundle third-party dependencies in node_modules","license":"MIT","repository":{"url":"git+https://github.com/rollup/plugins.git","directory":"packages/node-resolve"},"author":{"name":"Rich Harris","email":"richard.a.harris@gmail.com"},"homepage":"https://github.com/rollup/plugins/tree/master/packages/node-resolve/#readme","bugs":{"url":"https://github.com/rollup/plugins/issues"},"main":"./dist/cjs/index.js","module":"./dist/es/index.js","type":"commonjs","exports":{"require":"./dist/cjs/index.js","import":"./dist/es/index.js"},"engines":{"node":">= 10.0.0"},"scripts":{"build":"rollup -c","ci:coverage":"nyc pnpm test && nyc report --reporter=text-lcov > coverage.lcov","ci:lint":"pnpm build && pnpm lint","ci:lint:commits":"commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}","ci:test":"pnpm test -- --verbose && pnpm test:ts","prebuild":"del-cli dist","prepare":"if [ ! -d 'dist' ]; then pnpm build; fi","prepublishOnly":"pnpm build","prerelease":"pnpm build","pretest":"pnpm build","release":"pnpm plugin:release --workspace-root -- --pkg $npm_package_name","test":"ava && pnpm test:ts","test:ts":"tsc types/index.d.ts test/types.ts --noEmit"},"keywords":["rollup","plugin","es2015","npm","modules"],"peerDependencies":{"rollup":"^2.42.0"},"dependencies":{"@rollup/pluginutils":"^3.1.0","@types/resolve":"1.17.1","builtin-modules":"^3.1.0","deepmerge":"^4.2.2","is-module":"^1.0.0","resolve":"^1.19.0"},"devDependencies":{"@babel/core":"^7.10.5","@babel/plugin-transform-typescript":"^7.10.5","@rollup/plugin-babel":"^5.1.0","@rollup/plugin-commonjs":"^16.0.0","@rollup/plugin-json":"^4.1.0","es5-ext":"^0.10.53","rollup":"^2.67.3","source-map":"^0.7.3","string-capitalize":"^1.0.1"},"types":"types/index.d.ts","ava":{"babel":{"compileEnhancements":false},"files":["!**/fixtures/**","!**/helpers/**","!**/recipes/**","!**/types.ts"]},"_id":"@rollup/plugin-node-resolve@13.2.0","_nodeVersion":"14.19.1","_npmVersion":"6.14.16","dist":{"integrity":"sha512-GuUIUyIKq7EjQxB51XSn6zPHYo+cILQQBYOGYvFFNxws2OVOqCBShAoof2hFrV8bAZzZGDBDQ8m2iUt8SLOUkg==","shasum":"ac516c4649b7133273a944778df439d3081dc3d1","tarball":"https://registry.npmmirror.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.2.0.tgz","fileCount":8,"unpackedSize":94526,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHEI4N9i+3JJZrdfJSUPxonCMOCumiBQCEQxOYlq+xnoAiEAm3/Pp06Hne6DyW3lEYn/rjzmeIj/mfvf+FZ1x17ACWo="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVJSqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrimg//SY7WFeyO9gaa9j9h4JAVwokpcq8a/xOyJ0wTdg+1rSExM7tj\r\nAtOTD4ZWdMZoALMTNFdsjdA5WDu7UlB2IWpW861MS2IbqyhDC21EFdA9k2AD\r\ntQk0og+nwY6THzyVNQm0U4j9jKg88VSByHlV/OjfujccSquXesx8eNvpwGbE\r\nU8wAINtzFFFEM2VGvaQxg6DBXzDiyti/vCF4UqGu5sRvKnUSvkUwaflxir6e\r\nloxgEgMbnp0LJd61YlUYz3mTFp1kOGolcB4Gn8gVGD8AxrDquEVYf49IyHo3\r\nm9BRZUNMSL8dHBvKV9Yq5fqJAo4au/5fdB1fNDFVVSDNHfUTp2c+r1VSw0PZ\r\npiX38ov16t/QuGZQm/vUCwkGLvpEKw5aGygXWfI8nREbE97eWEmadg+aGbZM\r\nWKAoc29Sn+pLSGmymYs9K4DDAVWOfLEdRs2lc5Ul1YNaZo7/xqvt16uPTiVp\r\nlnaKx9OIUFiaTJVuu4FazIyPQoiCImzhLR257hPu11sAY+K0wRg/JX71OEtC\r\nIAtNv7PQGMLAnaxymsfQYjMZuL4ylGPWuO4znR1U2SVAElDkka6QVGWaDUiS\r\nIwGajg/s3JAYE3mtGkMiM4gFRyBTYVNx4cFP8e8Qkpcr4rCjuLFBcSWofSg3\r\nWq7NFYkiG+poJ6WF8+cIvoC/i/X9XRxvEs0=\r\n=hPvv\r\n-----END PGP SIGNATURE-----\r\n","size":24164},"_npmUser":{"name":"shellscape","email":"andrew@shellscape.org"},"directories":{},"maintainers":[{"name":"shellscape","email":"andrew@shellscape.org"},{"name":"rich_harris","email":"richard.a.harris@gmail.com"},{"name":"guybedford","email":"guybedford@gmail.com"},{"name":"lukastaegert","email":"lukas.taegert@tngtech.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-node-resolve_13.2.0_1649710250310_0.4187934759793819"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-04-11T21:02:09.942Z","readme":"[npm]: https://img.shields.io/npm/v/@rollup/plugin-node-resolve\n[npm-url]: https://www.npmjs.com/package/@rollup/plugin-node-resolve\n[size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-node-resolve\n[size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-node-resolve\n\n[![npm][npm]][npm-url]\n[![size][size]][size-url]\n[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com)\n\n# @rollup/plugin-node-resolve\n\n🍣 A Rollup plugin which locates modules using the [Node resolution algorithm](https://nodejs.org/api/modules.html#modules_all_together), for using third party modules in `node_modules`\n\n## Requirements\n\nThis plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v8.0.0+) and Rollup v1.20.0+.\n\n## Install\n\nUsing npm:\n\n```console\nnpm install @rollup/plugin-node-resolve --save-dev\n```\n\n## Usage\n\nCreate a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin:\n\n```js\nimport { nodeResolve } from '@rollup/plugin-node-resolve';\n\nexport default {\n input: 'src/index.js',\n output: {\n dir: 'output',\n format: 'cjs'\n },\n plugins: [nodeResolve()]\n};\n```\n\nThen call `rollup` either via the [CLI](https://www.rollupjs.org/guide/en/#command-line-reference) or the [API](https://www.rollupjs.org/guide/en/#javascript-api).\n\n## Package entrypoints\n\nThis plugin supports the package entrypoints feature from node js, specified in the `exports` or `imports` field of a package. Check the [official documentation](https://nodejs.org/api/packages.html#packages_package_entry_points) for more information on how this works. This is the default behavior. In the abscence of these fields, the fields in `mainFields` will be the ones to be used.\n\n## Options\n\n### `exportConditions`\n\nType: `Array[...String]`
\nDefault: `[]`\n\nAdditional conditions of the package.json exports field to match when resolving modules. By default, this plugin looks for the `['default', 'module', 'import']` conditions when resolving imports.\n\nWhen using `@rollup/plugin-commonjs` v16 or higher, this plugin will use the `['default', 'module', 'require']` conditions when resolving require statements.\n\nSetting this option will add extra conditions on top of the default conditions. See https://nodejs.org/api/packages.html#packages_conditional_exports for more information.\n\nIn order to get the [resolution behavior of Node.js](https://nodejs.org/api/packages.html#packages_conditional_exports), set this to `['node']`.\n\n### `browser`\n\nType: `Boolean`
\nDefault: `false`\n\nIf `true`, instructs the plugin to use the browser module resolutions in `package.json` and adds `'browser'` to `exportConditions` if it is not present so browser conditionals in `exports` are applied. If `false`, any browser properties in package files will be ignored. Alternatively, a value of `'browser'` can be added to both the `mainFields` and `exportConditions` options, however this option takes precedence over `mainFields`.\n\n> This option does not work when a package is using [package entrypoints](https://nodejs.org/api/packages.html#packages_package_entry_points)\n\n### `moduleDirectories`\n\nType: `Array[...String]`
\nDefault: `['node_modules']`\n\nOne or more directories in which to recursively look for modules.\n\n### `dedupe`\n\nType: `Array[...String]`
\nDefault: `[]`\n\nAn `Array` of modules names, which instructs the plugin to force resolving for the specified modules to the root `node_modules`. Helps to prevent bundling the same package multiple times if package is imported from dependencies.\n\n```js\ndedupe: ['my-package', '@namespace/my-package'];\n```\n\nThis will deduplicate bare imports such as:\n\n```js\nimport 'my-package';\nimport '@namespace/my-package';\n```\n\nAnd it will deduplicate deep imports such as:\n\n```js\nimport 'my-package/foo.js';\nimport '@namespace/my-package/bar.js';\n```\n\n### `extensions`\n\nType: `Array[...String]`
\nDefault: `['.mjs', '.js', '.json', '.node']`\n\nSpecifies the extensions of files that the plugin will operate on.\n\n### `jail`\n\nType: `String`
\nDefault: `'/'`\n\nLocks the module search within specified path (e.g. chroot). Modules defined outside this path will be ignored by this plugin.\n\n### `mainFields`\n\nType: `Array[...String]`
\nDefault: `['module', 'main']`
\nValid values: `['browser', 'jsnext:main', 'module', 'main']`\n\nSpecifies the properties to scan within a `package.json`, used to determine the bundle entry point. The order of property names is significant, as the first-found property is used as the resolved entry point. If the array contains `'browser'`, key/values specified in the `package.json` `browser` property will be used.\n\n### `preferBuiltins`\n\nType: `Boolean`
\nDefault: `true` (with warnings if a builtin module is used over a local version. Set to `true` to disable warning.)\n\nIf `true`, the plugin will prefer built-in modules (e.g. `fs`, `path`). If `false`, the plugin will look for locally installed modules of the same name.\n\n### `modulesOnly`\n\nType: `Boolean`
\nDefault: `false`\n\nIf `true`, inspect resolved files to assert that they are ES2015 modules.\n\n### `resolveOnly`\n\nType: `Array[...String|RegExp] | (module: string) => boolean`
\nDefault: `null`\n\nAn `Array` which instructs the plugin to limit module resolution to those whose names match patterns in the array. _Note: Modules not matching any patterns will be marked as external._\n\nAlternatively, you may pass in a function that returns a boolean to confirm whether the module should be included or not.\n\nExamples:\n\n- `resolveOnly: ['batman', /^@batcave\\/.*$/]`\n- `resolveOnly: module => !module.includes('joker')`\n\n### `rootDir`\n\nType: `String`
\nDefault: `process.cwd()`\n\nSpecifies the root directory from which to resolve modules. Typically used when resolving entry-point imports, and when resolving deduplicated modules. Useful when executing rollup in a package of a mono-repository.\n\n```\n// Set the root directory to be the parent folder\nrootDir: path.join(process.cwd(), '..')\n```\n\n### `ignoreSideEffectsForRoot`\n\nIf you use the `sideEffects` property in the package.json, by default this is respected for files in the root package. Set to `true` to ignore the `sideEffects` configuration for the root package.\n\n## Preserving symlinks\n\nThis plugin honours the rollup [`preserveSymlinks`](https://rollupjs.org/guide/en/#preservesymlinks) option.\n\n## Using with @rollup/plugin-commonjs\n\nSince most packages in your node_modules folder are probably legacy CommonJS rather than JavaScript modules, you may need to use [@rollup/plugin-commonjs](https://github.com/rollup/plugins/tree/master/packages/commonjs):\n\n```js\n// rollup.config.js\nimport { nodeResolve } from '@rollup/plugin-node-resolve';\nimport commonjs from '@rollup/plugin-commonjs';\n\nexport default {\n input: 'main.js',\n output: {\n file: 'bundle.js',\n format: 'iife',\n name: 'MyModule'\n },\n plugins: [nodeResolve(), commonjs()]\n};\n```\n\n## Resolving Built-Ins (like `fs`)\n\nBy default this plugin will prefer built-ins over local modules, marking them as external.\n\nSee [`preferBuiltins`](#preferbuiltins).\n\nTo provide stubbed versions of Node built-ins, use a plugin like [rollup-plugin-node-polyfills](https://github.com/ionic-team/rollup-plugin-node-polyfills) and set `preferBuiltins` to `false`. e.g.\n\n```js\nimport { nodeResolve } from '@rollup/plugin-node-resolve';\nimport nodePolyfills from 'rollup-plugin-node-polyfills';\nexport default ({\n input: ...,\n plugins: [\n nodePolyfills(),\n nodeResolve({ preferBuiltins: false })\n ],\n external: builtins,\n output: ...\n})\n```\n\n## Resolving require statements\n\nAccording to [NodeJS module resolution](https://nodejs.org/api/packages.html#packages_package_entry_points) `require` statements should resolve using the `require` condition in the package exports field, while es modules should use the `import` condition.\n\nThe node resolve plugin uses `import` by default, you can opt into using the `require` semantics by passing an extra option to the resolve function:\n\n```js\nthis.resolve(importee, importer, {\n skipSelf: true,\n custom: { 'node-resolve': { isRequire: true } }\n});\n```\n\n## Meta\n\n[CONTRIBUTING](/.github/CONTRIBUTING.md)\n\n[LICENSE (MIT)](/LICENSE)\n"}