Skip to content
New issue

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

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

Already on GitHub? # to your account

sourceMappingUrl is wrong #81

Closed
frankrrr opened this issue Apr 10, 2015 · 14 comments
Closed

sourceMappingUrl is wrong #81

frankrrr opened this issue Apr 10, 2015 · 14 comments

Comments

@frankrrr
Copy link

Same problem here as #58, even when devtool = source-map.

/*# sourceMappingURL=../../../sass.map */

Just tried to run the demo test/sourceMap too, which isn't working either:

/*# sourceMappingURL=test/output/sass.map */

The file sass.map isn't generated. I'm using node-sass 3.0.0-beta.5 and sass-loader 1.0.1 and also tried other versions. Any ideas?

@jhnns
Copy link
Member

jhnns commented Apr 10, 2015

Is the URL wrong or is the map file just not generated?

@frankrrr
Copy link
Author

I think both, it should generate for example: styles.sourcemap.css.map (in stead of sass.map?)

@jhnns
Copy link
Member

jhnns commented Apr 10, 2015

You're right. It looks like this has changed in webpack somehow... need to investigate.

@jeloi
Copy link

jeloi commented Apr 13, 2015

+1

@jjeising
Copy link

With the current webpack 1.8.9 and extract-text-plugin the following will be outputted in the .css file:

…
/*# sourceMappingURL=js/sass.map */
/*# sourceMappingURL=app.css.map*/

The later app.css.map exists and contains the .scss content, while the first isn't generated (as before). Config is

        loader: ExtractTextPlugin.extract('css?sourceMap!sass?sourceMap&sourceMapContents')

When deleting the first line manually everything looks fine in the browser.

@jhnns
Copy link
Member

jhnns commented Apr 28, 2015

Thx for investigating this.... so maybe we just need to remove all the sourceMappingURL references added by libsass?

@jjeising
Copy link

That could be a solution, though I haven't tested other configurations. Removing this line does not work, as the map from libsass is needed. Maybe there should be an option for libsass to generate a source map without adding a reference?

@jhnns
Copy link
Member

jhnns commented Apr 28, 2015

Maybe there should be an option for libsass to generate a source map without adding a reference

Well, that option doesn't make sense from libsass' point of view ^^

@paddycarver
Copy link

Forgive me if I'm an idiot, but isn't there already an option for that?

@jjeising
Copy link

Adding

  if (opt.sourceMap) {
    
    opt.sourceMap = this.options.output.path + '/sass.map';
+   opt.omitSourceMapUrl = true;
  }

works fine for me.

@jhnns
Copy link
Member

jhnns commented May 6, 2015

I'll try that out, thanks!

@jjeising
Copy link

Will this be added to the official distribution at some point?

jhnns added a commit that referenced this issue Jul 23, 2015
Fix for issue #81 - sourceMappingUrl is wrong.
@jhnns
Copy link
Member

jhnns commented Jul 23, 2015

Yep. See #123

@jhnns jhnns closed this as completed Jul 23, 2015
@jjeising
Copy link

Thanks!

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

No branches or pull requests

5 participants