Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs for loadPartialConfig file handling changes #2333

Merged
merged 2 commits into from Oct 21, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/core.md
Expand Up @@ -258,6 +258,11 @@ resolves the plugins and presets and proceeds no further. The expectation is
that callers will take the config's `.options`, manipulate it as they see fit
and pass it back to Babel again.

This function accepts one additional option in addition to the standard [options](#options): `showIgnoredFiles`.
kaicataldo marked this conversation as resolved.
Show resolved Hide resolved
When set to true, `loadPartialConfig` always returns a result when a file is ignored, rather than `null`.
This is useful in order to allow the caller to access the list of files that influenced this outcome, e.g.
for watch mode. The caller can determine whether a file was ignored based on the returned `fileHandling` property.

* `babelrc: string | void` - The path of the [file-relative configuration](config-files.md#file-relative-configuration) file, if there was one.
* `babelignore: string | void` - The path of the `.babelignore` file, if there was one.
* `config: string | void` - The path of the [project-wide config file](config-files.md#project-wide-configuration) file, if there was one.
Expand All @@ -268,6 +273,9 @@ and pass it back to Babel again.
to false so that later calls to Babel will not make a second attempt to
load config files.
* `hasFilesystemConfig(): boolean` - Check if the resolved config loaded any settings from the filesystem.
* `fileHandling` - This is set to `"transpile"`, `"ignored"`, or `"unsupported"` to indicate to the caller what to do with this file.
* `files` - A `Set` of file paths that were read to build the resulting config, including project wide config files, local config files,
extended config files, ignore files, etc. Useful for implementing watch mode or cache invalidation.

[`ConfigItem`](#configitem-type) instances expose properties to introspect the values, but each
item should be treated as immutable. If changes are desired, the item should be
Expand Down