A re-write of sourcemap-validator using React, Node, and Google Cloud Functions.
sourcemaps.io is a web application that takes a URL for a target transpiled/minified JavaScript file (e.g. https://example.com/js/app.min.js
), and verifies:
sourceMappingURL
or[X-]SourceMap
header is present- Both the transpiled/minified file and source map file are reachable via HTTP
- The resolved source map is valid JSON, and parses using Mozilla's source-map library
- Lines and columns line up as expected
- ... and more, see tests
make test
make client-server
A local development server will serve the validation function for development.
make backend-server
NOTE: Right now the local server still writes JSON reports to a production Google Cloud Storage bucket. You must have the following shell variables exported (see Deploy to Google Cloud Platform below).
export GCLOUD_PROJECT=myproject-server
export GCLOUD_DATA_BUCKET=myproject-reports
make backend-server
This repository is already configured to automatically deploy to https://sourcemaps.io. But for posterity, this documents how to configure your own Google Cloud deployment environment and how to use the deploy scripts.
< 8000 div class="markdown-heading" dir="auto">