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

Extracted "*.map.css" file doesn't contain hierarchy of folders for the "sources". #30

Closed
siarheiyelin opened this issue Jan 13, 2023 · 2 comments

Comments

@siarheiyelin
Copy link

Extracted "*.map.css" file doesn't contain hierarchy of folders for the "sources".

At current moment, this library internally uses "rollup-plugin-postcss" as a dependency. And therefore it inherits the following issue related to extracted source maps: egoist/rollup-plugin-postcss#441

I wonder, is it possible to apply some workaround to fix this issue somehow?

Actual result:
{"version":3,"sources":["test.scss"]...
Expected result:
{"version":3,"sources":["../src/nestedFolder1/nestedFolder2/test.scss"]...

@siarheiyelin
Copy link
Author

siarheiyelin commented Jan 13, 2023

Okay, it seems I've just found a workaround for this - it's necessary to pass "to" attribute via options, e.g.:

rollupPluginPostCssModules({ sourceMap: true, modules: true, extract: "styles.css", **to: path.resolve("./build/styles.css")** })

As a result the source location looks like this:

{"version":3,"sources":["../src/nestedFolder1/nestedFolder2/test.scss"],

Probably it makes sense to set it automatically. At least, the "postcss" docs mention, that it's usually set automatically by runners. https://github.com/postcss/postcss.

@flying-sheep
Copy link
Owner

I’m passing on most options to https://github.com/egoist/rollup-plugin-postcss, so I think you should post this feature request there. I’m going to close this, but if you have a good reason why it’s supposed to be implemented here instead, I’ll happily reopen!

@flying-sheep flying-sheep closed this as not planned Won't fix, can't repro, duplicate, stale Jan 13, 2023
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