Skip to content

Copies source to internal publish directory and updates map files

Notifications You must be signed in to change notification settings

digable1/sourcemap-copy

Repository files navigation

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": "."
}

About

Copies source to internal publish directory and updates map files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published