Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Janiczek/elm-sourcemap
A builder for Source Maps (revision 3)
https://github.com/Janiczek/elm-sourcemap
Last synced: 2 months ago
JSON representation
A builder for Source Maps (revision 3)
- Host: GitHub
- URL: https://github.com/Janiczek/elm-sourcemap
- Owner: Janiczek
- License: apache-2.0
- Created: 2022-07-06T22:32:19.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-19T18:32:56.000Z (about 2 years ago)
- Last Synced: 2024-02-13T10:05:27.322Z (11 months ago)
- Language: Elm
- Size: 42 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-elm-pltd - Janiczek/elm-sourcemap - A library for generating source maps (for use in browser step debuggers, handy for languages compiling to JavaScript). (Packages / Code Generation)
README
# elm-sourcemap
A builder for Source Maps (revision 3).
* [Spec](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit)
* [`mozilla/source-map`](https://github.com/mozilla/source-map): reference JS implementation
* [Visualizer](http://sokra.github.io/source-map-visualization/)Source Map is a collection of mappings from a generated (often minified) file to
the original source code (across multiple files if needed).## Usage
```elm
import SourceMapSourceMap.empty
|> SourceMap.withFile "elm.min.js"
|> SourceMap.addMapping
{ generatedLine = 3
, generatedColumn = 10
, source = "Main.elm"
, originalLine = 10
, originalColumn = 1
, name = Just "init"
}
|> SourceMap.toString{-->
{
"version": 3,
"sources": [
"Main.elm"
],
"names": [
"init"
],
"mappings": ";;SASAA",
"file": "elm.min.js"
}-}
```