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
+17-5
Original file line number
Diff line number
Diff line change
@@ -165,6 +165,8 @@ Default: `null`
165
165
166
166
An object of configuration files to find. Each property is keyed by the default basename of the file being found, and the value is an array of [path arguments](#path-arguments) of which the order indicates priority to find.
167
167
168
+
See [Config Files](#config-files) for the config file specification.
169
+
168
170
**Note:** This option is useful if, for example, you want to support an `.apprc` file in addition to an `appfile.js`. If you only need a single configuration file, you probably don't need this. In addition to letting you find multiple files, this option allows more fine-grained control over how configuration files are located.
@@ -492,6 +491,7 @@ A function called after your application is executed. When invoked, `this` will
492
491
-`modulePath`: the full path to the local module your project relies on (if found)
493
492
-`modulePackage`: the contents of the local module's package.json (if found)
494
493
-`configFiles`: an object of filepaths for each found config file (filepath values will be null if not found)
494
+
-`config`: an object with keys matching `configFiles` but with the loaded config object
495
495
496
496
### events
497
497
@@ -582,6 +582,18 @@ Hacker.on('respawn', function (flags, child) {
582
582
Event will be triggered for this command:
583
583
`hacker --harmony commmand`
584
584
585
+
## Config files
586
+
587
+
Liftoff supports a small definition of config files, but all details provided by users will be available in `env.config`.
588
+
589
+
### `extends`
590
+
591
+
All `extends` properties will be traversed and become the basis for the resulting config object. Any path provided for `extends` will be loaded with node's `require`, so all extensions and loaders supported on the Liftoff instance will be available to them.
592
+
593
+
### Field matching the `configName`
594
+
595
+
Users can override the `configPath` via their config files by specifying a field with the same name as the primary `configName`. For example, the `hackerfile` property in a `configFile` will resolve the `configPath` and `configBase` against the path.
596
+
585
597
## Examples
586
598
587
599
Check out how [gulp][gulp-cli-index] uses Liftoff.
0 commit comments