Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/meixg/unchanged-file-sourcemap-generator

generate sourcemap from an unchanged js file.
https://github.com/meixg/unchanged-file-sourcemap-generator

sourcemap

Last synced: 16 days ago
JSON representation

generate sourcemap from an unchanged js file.

Awesome Lists containing this project

README

        

# unchanged-file-sourcemap-generator

generate sourcemap from an unchanged js file.

## why

Sometimes we just want to combine some js files into one, and generate a sourcemap. In this situation, some js file may not need to be compiled by babel or some other compiler. Sourcemaps for these files need to be generated on our own.

Fortunately, this module can do this for you.

## quick start

```javascript
const generate = require('unchanged-file-sourcemap-generator');

const map = generate(sourceString, {
file: 'index.js',
sourceRoot: ''
});
```

## options

options are same as [https://github.com/mozilla/source-map#new-sourcemapgeneratorstartofsourcemap](https://github.com/mozilla/source-map#new-sourcemapgeneratorstartofsourcemap).

- file

The filename of the generated source that this source map is associated with.

- sourceRoot

A root for all relative URLs in this source map.