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: README.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -115,7 +115,7 @@ How to handle the `node:` scheme used in recent versions of Node (i.e., `import
115
115
> _Note that scheme handling is always applied, regardless of the `builtins` options being enabled or not._
116
116
117
117
#### packagePath?: string | string[] = []
118
-
If you're working with monorepos, the `packagePath` option is made for you. It can take a path, or an array of paths, to your package.json file(s). If not specified, the default is to start with the current directory's package.json then go up scan for all `package.json` files in parent directories recursively until either the root git directory is reached or until no other `package.json` can be found.
118
+
If you're working with monorepos, the `packagePath` option is made for you. It can take a path, or an array of paths, to your package.json file(s). If not specified, the default is to start with the current directory's package.json then go up scan for all `package.json` files in parent directories recursively until either the root git directory is reached, the root of the monorepo is reached, or no other `package.json` can be found.
Set the `deps`, `devDeps`, `peerDeps` and `optDeps` options to `false` to prevent the corresponding dependencies from being externalized, therefore letting Rollup bundle them with your code.
@@ -151,7 +151,7 @@ nodeExternals({
151
151
It uses an exact match against your imports _as written in your code_. No resolving of path aliases or substitutions is made:
152
152
153
153
```js
154
-
// In your code, say '@/lib' is an alias for node_modules/deep/path/to/some/lib:
154
+
// In your code, say '@/lib' is an alias for source/deep/path/to/some/lib:
155
155
importsomethingfrom'@/lib'
156
156
```
157
157
@@ -160,7 +160,7 @@ If you don't want `lib` bundled in, then write:
160
160
```js
161
161
// In rollup.config.js:
162
162
nodeExternals({
163
-
include:'@/mylib'
163
+
include:'@/lib'
164
164
})
165
165
```
166
166
@@ -180,13 +180,13 @@ export default {
180
180
}
181
181
```
182
182
183
-
As a general rule of thumb, you will want to always make this plugin the first one in the `plugins` array.
183
+
Note that as of version 7, this plugin's `resolveId` hook has a `order: 'pre'` property that will make Rollup call it very early in the module resolution process. Nevertheless, it is best to always make this plugin the first one in the `plugins` array.
184
184
185
185
### 4/ Rollup rules
186
186
Rollup's own `external` configuration option always takes precedence over this plugin. This is intentional.
187
187
188
188
### 5/ Using with Vite
189
-
While this plugin has always been compatible with Vite, it was previously necessary to use the following `vite.config.js` to make it work reliably in every situations:
189
+
While this plugin has always been compatible with Vite, it was previously necessary to use the following `vite.config.js` to make it work reliably in every situation:
0 commit comments