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

build with sourcemapper #7

Open
tophf opened this issue Jan 19, 2022 · 5 comments
Open

build with sourcemapper #7

tophf opened this issue Jan 19, 2022 · 5 comments

Comments

@tophf
Copy link
Member

tophf commented Jan 19, 2022

Stylus arguably needs source maps in order to report correct position of errors/warnings.
Hopefully the extra size isn't too big, I tried building this repo but got a bunch of errors for circular dependencies and whatnot.

@eight04
Copy link
Collaborator

eight04 commented Jan 19, 2022

What is sourcemapper? Can you repro the line number issue in the demo?

@tophf
Copy link
Member Author

tophf commented Jan 19, 2022

It's the feature that maps source line/column positions to the compiled output so Stylus extension can report correct errors in case parsing failed while building moz-sections from the compiled sourceCode.

@tophf
Copy link
Member Author

tophf commented Jan 19, 2022

Here:

"stylus/lib/visitor/sourcemapper.js",

@eight04
Copy link
Collaborator

eight04 commented Jan 20, 2022

Make sense, but sounds like a feature that will be rarely used.

It depends on source-map, which is 106kB uncompressed and 36kB minified according to bundlephobia.

@tophf
Copy link
Member Author

tophf commented Jan 20, 2022

Too big. We could try to add our own code that simply makes an array of positions, not a full-fledged sourcemap, I guess.

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