0.0.3 • Published 8 months ago

sourcemap-copy v0.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
8 months ago

Copy Sources to publish folder and update Sourcmap references

npm

local: npm install -D sourcemap-copy Global: npm install -g -D sourcemap-copy

Invocation

Local: npx sourcemap-copy Global: sourcemap-copy

Overview

This command:

  1. Takes the source files in a project and copies it to a directory within the publish directory (defaults to 'dist/_src')
  2. Updates the .map files within the publish directory to reference the copied source files (defaults to 'dist')

It is meant for npm packages that might be imported to frameworks where sourcemap files no longer point to the right location because the original source files are not packages. However, sourcemap capability is desired in projects that import your package for future debugging.

Command-line Parameters

  1. --quiet (-q): Suppresses all messages from this tool
  2. --help (h): Help section

Configuration

There are configuration options to:

  1. Tell this tool how to go from the project root directory to the publish or 'dist' directory in relative path terms (defaults to 'dist')
  2. Tell this tool how to get from the root directory to the publish "src" directory in relative path terms (defaults to 'dist/_src/)
  3. Define the internal 'src' directory with the publish directory (defaults to '_src')
  4. The extension that defines a sourcemap file (defaults to '.map')
  5. Define the directory this tool resides in (defaults to '.')
  6. Tell this tool how to get from the directory this tool resides in to the project root (defaults to '.')

Note: Do not supply the ending path separators to the above configurations

The JSON default for this configuration is:

{
    "rootToDist": "dist",
    "distSource": "_src",
    "rootToDistSrc": "dist/_src",
    "allowedFileExtension": ".map",
    "excluded": [
        "node_modules",
        "spec",
        ".git"
    ],
    "utilsDirectory": ".",
    "utilsToRoot": "."
}
0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

9 months ago