myrne / performance-now

Implements performance.now (based on process.hrtime).
MIT License
162 stars 26 forks source link

sourceMappingURL directive interferes with source mapping when bundling #2

Closed davidmason closed 10 years ago

davidmason commented 10 years ago

When I use webpack to bundle commonjs modules, the source mapping directive from performance-now.js is brought in and interferes with the browser's ability to pick up the source map for the bundle.

This is a transient dependency for my module, so I am not able to use a coffeescript loader to bring in performance-now.coffee directly. Is the source map useful other than during development? If not, the directive would ideally not appear in the published javascript.

This is what I end up with in my bundle:

    ...
    /*
    //@ sourceMappingURL=performance-now.map
    */

    /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(19)))

/***/ }
/******/ ])
/*
//@ sourceMappingURL=bundle.js.map
*/
sokra commented 10 years ago

This is an bundler issue, not an issue of performance-now. It has been fixed for webpack...

myrne commented 10 years ago

@davidmason I'm closing this. IMO bundlers should be able to handle source map comments, and as I understand it, there's now a way to make it work in webpack.