{"name":"@rollup/plugin-node-resolve","version":"13.1.1","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","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.58.0","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.1.1","_nodeVersion":"14.18.2","_npmVersion":"6.14.15","dist":{"integrity":"sha512-6QKtRevXLrmEig9UiMYt2fSvee9TyltGRfw+qSs6xjUnxwjOzTOqy+/Lpxsgjb8mJn1EQNbCDAvt89O4uzL5kw==","shasum":"d38ba06e7b181ab4df64c75409b43d9bdc95ae34","tarball":"https://registry.npmmirror.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.1.1.tgz","fileCount":8,"unpackedSize":92904,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJht1JoCRA9TVsSAnZWagAAaOIQAJd6BoYaMCuZDMtw6yo3\nVhSMOjK+twZ2PM5sUe1P5+KcMplLHSG5ThIIpo4Kq6eWqfac3ZJuQsF0TVr1\n4k9lxy0pQjQham7vOsbGqA+gAfXA7Q67cEOBASUCc+fUSe/Rahkh7FKHeZpV\naKmdjTu3km/MraJV/SkQfQhXc8cFZ42BoimVnxvEaCke8jwZlwPSAHbYfwAK\nP+hoQ3sE9Yn8HtTaMik9o5rFZB0ViiOmGpRJrkkEN7pSG5BB9+/7WjdNXToe\nDOzKRlH1XMoEYCk4CBlfN38+azcW9gGJSsk279eCiUzt8PXJsqkQLPgjz4o/\n1aqGl+ieCh4vJ8t4GCzBfG+7Svk5BXR9Lp7ShglzFKydODK4uzKt1HViz9de\nL5b6djM1FIxgLa74k/tuLoCAjbE9TuGXs50C7u423kXBGwy0D79LNuKWWFcj\nUiKTyPjvF3xBs3F7eYiq77EYaMyA3sTFEudl3IsL3mNLfo0f/DfSAH66RI3H\nUUPQ0e5Y5fj6JkhpzwA/78vTVxBIBHZqdNGIdwe/7+fZOReW7Wy+B8OGcpx9\n+LjyI2ZSGEiof/0T/F0XHfkhai5I0fvbO3ClnLjHyIQyQdgvUH9lqPVFS+Kv\nSKidaKiDuRyAZGDyP/Pjm+XAngq3iYaWxVXuNxJgmkASxkffTh3147W7Wp/h\n3znG\r\n=ojlL\r\n-----END PGP SIGNATURE-----\r\n","size":23594,"noattachment":false},"_npmUser":{"name":"shellscape","email":"andrew@shellscape.org"},"directories":{},"maintainers":[{"name":"guybedford","email":"guybedford@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-node-resolve_13.1.1_1639404136576_0.17854064371203227"},"_hasShrinkwrap":false,"publish_time":1639404136744,"_cnpm_publish_time":1639404136744,"_cnpmcore_publish_time":"2021-12-14T03:52:08.148Z","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]`
\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\nExample: `resolveOnly: ['batman', /^@batcave\\/.*$/]`\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"}