-
exorcist(input, url, root, base, errorOnMissing) → {TransformStream}
-
Externalizes the source map of the file streamed in.
The source map is written as JSON to
file, and the original file is streamed out with itssourceMappingURLset to the path offile(or to the value ofurl).Events (in addition to stream events)
missing-mapemitted if no map was found in the stream and errorOnMissing is falsey (the src is still piped through in this case, but no map file is written)
Parameters:
Name Type Argument Description inputString / Object full path to the map file to which to write the extracted source map or a writable stream
urlString <optional>
full URL to the map file, set as
sourceMappingURLin the streaming output (default: file)rootString <optional>
root URL for loading relative source paths, set as
sourceRootin the source map (default: '')baseString <optional>
base path for calculating relative source paths (default: use absolute paths)
errorOnMissingBoolean <optional>
when truthy, causes 'error' to be emitted instead of 'missing-map' if no map was found in the stream (default: falsey)
Returns:
transform stream into which to pipe the code containing the source map
- Type
- TransformStream
exorcist
Externalizes the source map found inside a stream to an external `.js.map` file
MIT
13 个版本
安装
npm install exorcist
yarn add exorcist
pnpm add exorcist
bun add exorcist
