JSPM

vs-fix-sourcemaps

0.1.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 17
  • Score
    100M100P100Q53278F
  • License MIT

A Webpack plugin that fixes javascript sourcemaps in Visual Studios (2015), allowing for JSX and JS debugging directly in Visual Studios.

Package Exports

  • vs-fix-sourcemaps

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vs-fix-sourcemaps) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Fix Webpack JSX and JS Sourcemaps in Visual Studios

This plugin allows you to debug Webpack-bundled JS and JSX (yes, you heard that right, JSX) files directly in Visual Studios 2015 (from the original source);

Problem

Visual Studios (2015) doesn't support 'traditional' forms of JS debugging by setting breakpoints directly in Visual Studios. You can read the issues here:

A Solution

While the problem seems to be with Visual Studios, this webpack plugin seems to solve the issue (at least so far - if you find a bug please submit a PR).

This plugin only has one job: fix sourcemaps. No options or configuration - at least not yet.

If you are installing this plugin, you are most likely using IE. Make sure you are adding the Event Source pollyfill in IE if you are using hot middleware: https://github.com/glenjamin/webpack-hot-middleware/issues/11

Usage

In your Webpack config file, under plugins, add this plugin:

import VSFixSourceMapsPlugin from 'vs-fix-sourcemaps';
...
  plugins: [
    new VSFixSourceMapsPlugin(),
    new webpack.optimize.OccurenceOrderPlugin(), 
    new webpack.HotModuleReplacementPlugin(), // hot loading!
    new webpack.NoErrorsPlugin()
  ]
...

Known Issues

If you are using hot middleware of any kind (like React Hot Loader or React Transforms), hot loading will not always hit breakpoints in Visual Studios. It is buggy. The problem stems from the way the referenced paths are stored in memory by Visual Studios and Webpack. If it isn't working, refreshing the page should fix it. Lame, I know, but I have not found a fix for this yet. If you have a way to make it work, I am happy to accept your PR!

Contributing

Yes please. Submit your PR.