Skip to content

Commit 7aa0f76

Browse files
committed
documented configuration options
1 parent 613ca37 commit 7aa0f76

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,40 @@ faucet-pipeline-js
88
[faucet-pipeline](http://faucet-pipeline.org) plugin for bundling JavaScript
99
modules, along with extensions for ESNext, JSX and TypeScript
1010

11+
note that this repository comprises multiple packages; those residing within
12+
`pkg` are merely meta-packages to simplify dependency management for users
13+
14+
15+
Features and Configuration
16+
--------------------------
17+
18+
supported global features:
19+
20+
* compacting
21+
* Browserslist, determining transpilation targets
22+
* source maps (inline)
23+
* fingerprinting - NB: can be overriden with bundle-specific configuration
24+
25+
bundle-specific configuration:
26+
27+
| option | description | permitted values | examples |
28+
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
29+
| `source` (required) | references the entry-point module | file path <br> non-relative file paths are interpeted as identifiers for third-party packages | `"./src/index.js"` |
30+
| `target` (required) | references the target bundle | relative file path | `"./dist/bundle.js"` |
31+
| `compact` | activates bundle compression <br> NB: only takes effect if compacting is activated globally (typically via `--compact`) | `compact` (default), `minify` or `mangle` | |
32+
| `sourcemaps` | if truthy, activates inline source-map generation <br> NB: only takes effect if source maps are activated globally (typically via `--sourcemaps`) | `false` suppresses source maps | |
33+
| `format` | determines the bundle format | `iife` (default), `esm`, `umd`, `amd` or `commonjs` - all case-insensitive | |
34+
| `exports` | determines the bundle's API; the value exported by `source` (if any) | | `"MYLIB"`, for IIFEs |
35+
| `extensions` | additional file extensions for loading modules | | `[".jsx"]` |
36+
| `externals` | determines which modules/packages to exclude from the bundle | an object whose key refers to the respective module/package name, the value refers to a corresponding global variable | `{ jquery: "jQuery" }` |
37+
| `esnext` | if truthy, activates ESNext transpilation (typically determined by Browserslist) | | |
38+
| `esnext.browserslist` | custom Browserslist entry selection | the name of the Browserslist group to select <br> `false` suppresses automatic configuration via Browserslist | `esnext: { browserslist: "legacy" }` |
39+
| `esnext.exclude` | modules/packages for which to skip transpilation <br> this might be useful when importing distributions already optimized for ES5, for example | | `esnext: { exclude: ["jquery"] }` |
40+
| `jsx` | if truthy, activates JSX transpilation <br> additionally accepts the same options as `esnext` | | |
41+
| `jsx.pragma` | determines the function to use for JSX expressions | | `jsx: { pragma: "createElement" }` |
42+
| `jsx.fragment` | determines the function to use for JSX fragments | | `jsx: { fragment: "Fragment" }` |
43+
| `typescript` | if truthy, activates TypeScript transpilation <br> anything other than `true` will be passed through as TypeScript compiler options | | |
44+
1145

1246
Contributing
1347
------------

0 commit comments

Comments
 (0)