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
+41-4Lines changed: 41 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,7 @@ For more details on setting up Pack, refer to the [@pika/pack repository](https:
44
44
Add a fixed prefix to every file in the ZIP archive. By default, the zip contains exactly what would be installed into the `node_modules` directory -- phrased another way, if you unzipped an archive generated with the default settings, you would create one folder in your working directory for each of your package's dependencies.
45
45
46
46
> Listing your archive would look something like this:
47
+
>
47
48
> ```
48
49
> $ unzip -Z1 pkg/dist-dependencies.zip
49
50
> express/package.json
@@ -62,15 +63,19 @@ Use the `prefix` option to package all dependencies into a set of nested folders
62
63
"pipeline": [
63
64
["@pika/plugin-standard-pkg"],
64
65
["@pika/plugin-build-node"],
65
-
["@ryaninvents/plugin-bundle-dependencies", {
66
-
"prefix": "nodejs/node_modules"
67
-
}]
66
+
[
67
+
"@ryaninvents/plugin-bundle-dependencies",
68
+
{
69
+
"prefix": "nodejs/node_modules"
70
+
}
71
+
]
68
72
]
69
73
}
70
74
}
71
75
```
72
76
73
77
> Listing your archive would look something like this:
78
+
>
74
79
> ```
75
80
> $ unzip -Z1 pkg/dist-dependencies.zip
76
81
> nodejs/node_modules/express/package.json
@@ -81,8 +86,40 @@ Use the `prefix` option to package all dependencies into a set of nested folders
81
86
> # ... etc.
82
87
> ```
83
88
89
+
### `packageOverrides`
90
+
91
+
Override versions for some packages during the install step.
92
+
93
+
This plugin requires `file:` version specifications for any local packages, conflicting with Yarn's [expectation of version numbers for local packages](https://classic.yarnpkg.com/en/docs/workspaces/#toc-how-to-use-it). Using `packageOverrides` allows this plugin to handle this situation correctly without trying to re-implement any of Yarn's functionality.
94
+
95
+
Expects an object where the keys are package names and the values are override versions. The same lookup is used for both `dependencies` and `devDependencies`.
96
+
97
+
```json
98
+
{
99
+
"dependencies": {
100
+
"my-local-package": "0.0.0-semantically-released"
101
+
},
102
+
"@pika/pack": {
103
+
"pipeline": [
104
+
["@pika/plugin-standard-pkg"],
105
+
["@pika/plugin-build-node"],
106
+
[
107
+
"@ryaninvents/plugin-bundle-dependencies",
108
+
{
109
+
"packageOverrides": {
110
+
"my-local-package": "file:../my-local-package"
111
+
}
112
+
}
113
+
]
114
+
]
115
+
}
116
+
}
117
+
```
118
+
84
119
## Contributing
120
+
85
121
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
0 commit comments