You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/node-resolve/README.md
+8-14
Original file line number
Diff line number
Diff line change
@@ -62,18 +62,12 @@ Default: `false`
62
62
63
63
If `true`, instructs the plugin to use the `"browser"` property in `package.json` files to specify alternative files to load for bundling. This is useful when bundling for a browser environment. Alternatively, a value of `'browser'` can be added to the `mainFields` option. If `false`, any `"browser"` properties in package files will be ignored. This option takes precedence over `mainFields`.
64
64
65
-
### `customResolveOptions`
65
+
### `moduleDirectories`
66
66
67
-
Type: `Object`<br>
68
-
Default: `null`
69
-
70
-
An `Object` that specifies additional options that should be passed through to [`resolve`](https://www.npmjs.com/package/resolve).
67
+
Type: `Array[...String]`<br>
68
+
Default: `['node_modules']`
71
69
72
-
```
73
-
customResolveOptions: {
74
-
moduleDirectory: 'js_modules'
75
-
}
76
-
```
70
+
One or more directories in which to recursively look for modules.
Specifies 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.
124
118
125
-
### `only`
126
-
127
-
DEPRECATED: use "resolveOnly" instead
128
-
129
119
### `preferBuiltins`
130
120
131
121
Type: `Boolean`<br>
@@ -161,6 +151,10 @@ Specifies the root directory from which to resolve modules. Typically used when
161
151
rootDir: path.join(process.cwd(), '..')
162
152
```
163
153
154
+
## Preserving symlinks
155
+
156
+
This plugin honours the rollup [`preserveSymlinks`](https://rollupjs.org/guide/en/#preservesymlinks) option.
157
+
164
158
## Using with @rollup/plugin-commonjs
165
159
166
160
Since 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):
`preferring built-in module '${importee}' over local alternative at '${resolved}', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning`
244
+
`preferring built-in module '${importee}' over local alternative at '${resolvedWithoutBuiltins.location}', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning`
0 commit comments