Skip to content

Commit

Permalink
documented configuration options
Browse files Browse the repository at this point in the history
  • Loading branch information
FND committed Mar 22, 2019
1 parent a2741b9 commit 2b1e9d5
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,40 @@ faucet-pipeline-js
[faucet-pipeline](http://faucet-pipeline.org) plugin for bundling JavaScript
modules, along with extensions for ESNext, JSX and TypeScript

note that this repository comprises multiple packages; those residing within
`pkg` are merely meta-packages to simplify dependency management for users


Features and Configuration
--------------------------

supported global features:

* compacting
* Browserslist, determining transpilation targets
* source maps (inline)
* fingerprinting - NB: can be overriden with bundle-specific configuration

bundle-specific configuration:

| option | description | permitted values | examples |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
| `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"` |
| `target` (required) | references the target bundle | relative file path | `"./dist/bundle.js"` |
| `compact` | activates bundle compression <br> NB: only takes effect if compacting is activated globally (typically via `--compact`) | `compact` (default), `minify` or `mangle` | |
| `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 | |
| `format` | determines the bundle format | `iife` (default), `esm`, `umd`, `amd` or `commonjs` - all case-insensitive | |
| `exports` | determines the bundle's API; the value exported by `source` (if any) | | `"MYLIB"`, for IIFEs |
| `extensions` | additional file extensions for loading modules | | `[".jsx"]` |
| `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" }` |
| `esnext` | if truthy, activates ESNext transpilation (typically determined by Browserslist) | | |
| `esnext.browserslist` | custom Browserslist entry selection | the name of the Browserslist group to select <br> `false` suppresses automatic configuration via Browserslist | `esnext: { browserslist: "legacy" }` |
| `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"] }` |
| `jsx` | if truthy, activates JSX transpilation <br> additionally accepts the same options as `esnext` | | |
| `jsx.pragma` | determines the function to use for JSX expressions | | `jsx: { pragma: "createElement" }` |
| `jsx.fragment` | determines the function to use for JSX fragments | | `jsx: { fragment: "Fragment" }` |
| `typescript` | if truthy, activates TypeScript transpilation <br> anything other than `true` will be passed through as TypeScript compiler options | | `jsx: { fragment: "Fragment" }` |


Contributing
------------
Expand Down

0 comments on commit 2b1e9d5

Please sign in to comment.