Skip to content

Commit 38f4eb1

Browse files
committed
Update docs
1 parent b6794f9 commit 38f4eb1

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,17 @@ generate part of the packed filename. A personal preference is to set it to
124124
> NOTE: This step is not required if you use the
125125
> [internal packages strategy](#the-internal-packages-strategy) but you could
126126
> set it to `["src"]` instead of `["dist"]`.
127+
>
128+
> When using `includeDevDependencies`, packages that are only dev dependencies
129+
> (like ESLint configs or other build tools) don't require a `files` field since
130+
> they are not packed for deployment.
127131
128132
The isolate process uses (p)npm `pack` to extract files from package
129133
directories, just like publishing a package would.
130134

131-
For this to work it is required that you define the `files` property in each
132-
package manifest, as it declares what files should be included in the published
133-
output.
135+
For production dependencies, it is required that you define the `files` property
136+
in each package manifest, as it declares what files should be included in the
137+
published output.
134138

135139
Typically, the value contains an array with only the name of the build output
136140
directory. For example:
@@ -219,6 +223,11 @@ By default devDependencies are ignored and stripped from the isolated output
219223
`package.json` files. If you enable this the devDependencies will be included
220224
and isolated just like the production dependencies.
221225

226+
Note: Dev-only internal packages (like ESLint configs) that are included through
227+
this option don't require a `files` field in their package.json, only a
228+
`version` field. Production dependencies always require both `version` and
229+
`files` fields.
230+
222231
### pickFromScripts
223232

224233
Type: `string[]`, default: `undefined`

src/lib/manifest/validate-manifest.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,7 @@ export function validateManifestMandatoryFields(
3838
}
3939

4040
if (missingFields.length > 0) {
41-
const errorMessage =
42-
`Package at ${packagePath} is missing mandatory fields: ${missingFields.join(", ")}. ` +
43-
`The "version" field is required for pack to execute` +
44-
(requireFilesField
45-
? `, and the "files" field is required to declare what files should be included in the output.`
46-
: `.`) +
47-
` See the documentation for more details.`;
41+
const errorMessage = `Package at ${packagePath} is missing mandatory fields: ${missingFields.join(", ")}. See the documentation for more details.`;
4842

4943
log.error(errorMessage);
5044
throw new Error(errorMessage);

0 commit comments

Comments
 (0)