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

Docs wrong about sourceMapEmbed? #2729

Closed
Therealskythe opened this issue Sep 4, 2019 · 6 comments
Closed

Docs wrong about sourceMapEmbed? #2729

Therealskythe opened this issue Sep 4, 2019 · 6 comments

Comments

@Therealskythe
Copy link

Documentation says:

When sourceMap === true, the value of outFile is used as the target output location for the source map. When typeof sourceMap === "string", the value of sourceMap will be used as the writing location for the file.

My code is (dart-sass 1.22.10 & grunt 1.0.3):

options: {
    implementation: sass,
    outputStyle: 'compressed',
    outFile: 'foo.css.map',
    sourceMap: true,
    sourceMapEmbed: true
},

Expected behaviour: A sourcemap called foo.css.map should be created in root.
What happens: A sourcemap called styles.css.map is created next to the compiler css (styles.css).

Apart from that, I would expect the sourcemap URI to be embedded in the compiled CSS (by default btw, not because I added outFile and sourceMapEmbed). Doesnt happen.

What am I missing? This seems to have been confusing people for a looong time now #591.

@Therealskythe
Copy link
Author

I take that appendix back: the sourcemap was embedded, but post-css removed it afterwards. Maybe this heads-up helps others in this situation.

@nschonni
Copy link
Contributor

nschonni commented Sep 4, 2019

Dart-sass is a different project https://github.com/sass/dart-sass

@nschonni nschonni closed this as completed Sep 4, 2019
@Therealskythe
Copy link
Author

Therealskythe commented Sep 5, 2019

I know it's a different project, but it uses node-sass. The documentation even consists of direct links to node-sass docs and the only place sourceMapEmbed is explained is https://github.com/sass/node-sass.

So no reason to close this.

@nschonni
Copy link
Contributor

nschonni commented Sep 5, 2019

I know it's a different project, but it uses node-sass.

dart-sass doesn't use node-sass, but I believe there is the option in gulp-sass to use either :) From your description, you're using the Dart combo (implementation: sass). They keep the same API for compatibility, which is probably why some docs link point here

I take that appendix back: the sourcemap was embedded, but post-css removed it afterward

Don't think documenting what 3rd party libraries might do with the output after it's compiled fits here

@Therealskythe
Copy link
Author

Like I said, the only place sourceMapEmbed is explained is here. So it makes sense to ask about if it's bugged here, too, imho.

Don't think documenting what 3rd party libraries might do with the output after it's compiled fits here

I wasn't "documentating" any 3rd party libraries. I cleared up a part of my initial post to "help others in this situation".

@saper
Copy link
Member

saper commented Oct 21, 2019

@Therealskythe I am proposing some slight wording changes to the README file in #2754 (due to #2394).

I didn't realize one would like to have it all in different directory. You can give an absolute path, but the relative one will be to the CSS output file. I don't think this should be changed, but maybe you can explain a bit more about your use case?

Please feel free to propose a better wording for the documentation.

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

3 participants