1.0.0 • Published 4 years ago
esmultiloader v1.0.0
ESMultiloader
Node.js ESM loader for chaining multiple custom loaders.
- Fast and lightweight
- No configuration required, but configurable if needed
- Usage compliant with Node's own loader middleware chaining proposal
- Supports all three
resolve,loadandglobalPreloadloader hooks
Install
npm i esmultiloaderUsage
node --loader loader2 --loader ./loader1.js --loader esmultiloader file.jsOptional Configuration
Options can be passed to esmultiloader to configure it's behavior using the following / separated list syntax:
node --loader esmultiloader/booleanoption/option=123/...Where:
booleanoptionis atrue/falseoption which is implicitlytruewhen passed as an option.optionis an option with a required value to be passed after the=, default values for these options vary per option.- The first instance of a duplicated option takes precedence.
- A trailing slash does not matter.
| Option | Type | Default | Description |
|---|---|---|---|
iterative or ltr | Boolean | false | Chain loaders from left-to-right as described by the iterative chaining proposal instead of right-to-left. (Mutually exclusive with the option below) |
middleware or rtl | Boolean | true | Chain loaders from right-to-left as described by the middleware chaining proposal instead of left-to-right. (Mutually exclusive with the option above) |
debug | Boolean | false | Enable printing of esmultiloader debug logs. |