Initial idea from https://github.com/sokra/source-map-visualization
This app allows to debug and visualize source maps.
npm install @matthid/source-map-visualization -g
Starts a webserver for the given sourcemap files and lets you choose the file in the UI.
Arguments:
--port={port} Port to use (defaults to 8085)
--sm:{originalFile};{compiled.js};{sourcemap.js.map}
--sm:{originalFile};{compiled.js};{sourcemap.js.map};{name} Add the specified file. If {name} is ommited {originalFile} is used in the UI.
npm install --save-dev @matthid/source-map-visualization
add npm script to package.json:
{
"scripts": {
"check-sourcemaps": "source-map-visualization --sm=./src/fable-library/Array.fs;./build/fable-library/Array.js;./build/fable-library/Array.js.map"
// others
},
// dependencies
}See global installation for arguments.
Run npm
npm run check-sourcemaps
let path = require("path");
let app = require("@matthid/source-map-visualization");
let clientDir = path.resolve(__dirname, "../dist/Client");
// Start like CLI
app.startServerWithArgs(clientDir, process.argv); // argv given as specified in global installation
// Specifiy manually
let files =
[ { name: "Array.fs", converted: "./dist/Array.js", sourceMap: "./dist/Array.js.map", original: "./src/Array.ts" } ];
app.startServer(clientDir, port, files)You'll need to install the following pre-requisites in order to build the Source Map Visualizer
- The .NET Core SDK
- FAKE 5 installed as a global tool
- The Yarn package manager (you can also use
npmbut the usage ofyarnis encouraged). - Node LTS installed for the front end components.
- If you're running on OSX or Linux, you'll also need to install Mono.
Start Server (including client)
yarn client-build
yarn server-build
cd src/Server
node deploy/app.<hash>.js
Start Client (hot module reloading, needs a started server)
yarn client-start
To concurrently run the server and the client components in watch mode use the following command:
fake build -t RunYou will find more documentation about the used F# components at the following places:
If you want to know more about the full Azure Stack and all of it's components (including Azure) visit the official SAFE documentation.
- fake not found - If you fail to execute
fakefrom command line after installing it as a global tool, you might need to add it to yourPATHmanually: (e.g.export PATH="$HOME/.dotnet/tools:$PATH"on unix) - related GitHub issue