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

Adds support for source maps (Working) #6

Merged
merged 4 commits into from
Jun 11, 2019

Conversation

RedHatter
Copy link
Contributor

@RedHatter RedHatter commented Dec 1, 2018

Adds support for source maps. This should be merged asap in light of sveltejs/svelte#1863.

Comparison with #4.

  • postcss returns a SourceMapGenerator not a string or bare object. Before passing the sourcemap to svelte we convert it to a bare object
  • It's filename not fileName

arggh and others added 3 commits August 17, 2018 22:18
Refactored the process function to disable inline source maps, so
PostCSS will provide them separately in the result object.
@TehShrike
Copy link
Owner

Nice. What Svelte versions is this compatible with? Will it work with any old [email protected]?

@RedHatter
Copy link
Contributor Author

This shouldn't change the supported Svelte version but Svelte wont be able to make use of the sourcemaps until #1863 is merged.

.process(css)
.then(code => ({ code }))
.process(css, {
from: filename,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So PostCSS is cool with a from option property whose value is undefined?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefined? Svelte passes the filename into the callback which then gets passed to the process function and into postcss from. I tested it and it works fine on my system... am I missing something obvious?

Note: In the latest commit I fixed the name from fileName to filename, do you have that commit locally?

@TehShrike TehShrike merged commit bb1eff2 into TehShrike:master Jun 11, 2019
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

Successfully merging this pull request may close these issues.

3 participants