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

source map outputs '\\' but not '/' in the sources path list on Windows #4

Closed
benxshen opened this issue Dec 12, 2015 · 3 comments
Closed

Comments

@benxshen
Copy link

Here is my simple gulpfile, just copying from the given sample of simplifyify README.md:

var gulp        = require("gulp"),
    simplifyify = require("simplifyify");   // https://www.npmjs.com/package/simplifyify

gulp.task("browserify", function(done) {
  simplifyify("app.js",
    {
        outfile: "bundle.js",
        debug: true,
        minify: true
    })
    // .on("end", function() {
    //     // Finished successfully!
    //     done();
    // })
    .on("error", function(err) {
        // Something went wrong
        done(err);
    });
});

And the output of the bundle.js.map as below (my OS is Windows 10 64bit)

  "version": 3,
  "sources": [
    "node_modules\\browserify\\node_modules\\browser-pack\\_prelude.js",
    "app.js",
    "buttons\\button.js",
    "node_modules\\jquery\\dist\\jquery.js"
  ],
  ...

however, if I use browserify app.js --debug | exorcist bundle.js.map > bundle.js, I will get as follow:

  "version": 3,
  "sources": [
    "node_modules/browserify/node_modules/browser-pack/_prelude.js",
    "app.js",
    "buttons/button.js",
    "node_modules/jquery/dist/jquery.js"
  ],
  ...

I think the output path of the source with '' will be not correct when I deploy them to the server. Is it a bug? or where can I have an option to make the path separator to '/', but not system default sep ''?

Thank you.

@benxshen benxshen changed the title source map outputs '\\' but not '/' in the sources list on Windows source map outputs '\\' but not '/' in the sources path list on Windows Dec 12, 2015
@JamesMessinger
Copy link
Member

I think you're right, that this is a bug. When I get a chance, I'll look into it further to confirm whether it's a bug and get it fixed. Thanks for reporting it!

@JamesMessinger
Copy link
Member

I looked into this further, and I honestly don't know whether it's a bug or not. The source maps are created by Exorcist, which in-turn uses mold-source-map. That's where the backslashes are coming from. So, it may be a bug in mold-source-map, or it may not be a bug at all. I don't know the details of the source map spec, so I can't say for sure.

@JamesMessinger
Copy link
Member

I'm gonna' go ahead and close this issue, since I'm not sure if it's actually a bug or not. If it is a bug, then it's a bug in mold-source-map

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

No branches or pull requests

2 participants