Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brfs breaks source maps #7

Closed
mikolalysenko opened this issue Aug 7, 2013 · 8 comments
Closed

brfs breaks source maps #7

mikolalysenko opened this issue Aug 7, 2013 · 8 comments
Labels

Comments

@mikolalysenko
Copy link

I love brfs, but this issue is right now my number one annoyance. To replicate this, take any multifile bundle and add an fs.readSync with brfs. Open up the result in chrome, and you get a single giant blob.

Any ideas on what could be done to fix this situation?

@revolunet
Copy link

any news on this ? can brfs support source maps ?

@mattdesl
Copy link
Collaborator

I am not sure this issue will ever be solved with the current iteration of static-module – it will take a refactor (which might be worthwhile since that module has gotten pretty hairy) or building on top another source transformer altogether.

I experimented with the latter here:
https://github.com/Jam3/brfs-babel

It supports source maps and some (but not all) of brfs use cases. Since it builds on babel, things like removing nodes are trivial to implement. However, babel does not support async transformations, so it will probably never replace static-module.

@goto-bus-stop
Copy link
Member

f8c924a

📦 1.5.0

@boris-ulyanov
Copy link

Update 1.4.4 to 1.5.0 breaks sourcemap for my case:

  • node 8.9.4
  • budo 11.2.0 / browserify 16.1.0

@blackgate
Copy link

blackgate commented Mar 22, 2018

Still breaks the sourcemaps here too.

@goto-bus-stop
Copy link
Member

In what way? Can you share an example?

@blackgate
Copy link

Sure:

const fs = require("fs");
const browserify = require("browserify");
browserify("./script.js", { debug: true })
  .transform("babelify", {presets: ["env"], sourceMaps: true})
  .transform("brfs")
  .bundle()
  .pipe(fs.createWriteStream("bundle.js"));

With the .transform("brfs") line, the sourcemap contains the transpiled source instead of the original.

@goto-bus-stop
Copy link
Member

Thanks, moving to #86!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants