-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
chore: replace source-map with source-map-js #6556
Conversation
why does rollup need a bump? |
Hm... I didn't touch rollup. Though rebased from december branch. Will try to revert. |
source-map-js is a js fork with applied optimisations comparable with rust optimisation in latest source-map versions. Staying on js allows us to bundle package and not increase install size. As a bonus I added support for importing from lib directly so we could avoid bundling whole package. See 7rulnik/source-map-js#13 ``` du -ck dist/node ``` before: 4164 kB after: 4140 kB
80e0e74
to
7c3aca5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💚
I need GitHub to let us add the 🔥 emoji as reactions |
@@ -70,7 +70,7 @@ import type { ResolvedConfig } from '../config' | |||
import { buildErrorMessage } from './middlewares/error' | |||
import type { ModuleGraph } from './moduleGraph' | |||
import { performance } from 'perf_hooks' | |||
import { SourceMapConsumer } from 'source-map' | |||
import { SourceMapConsumer } from 'source-map-js/lib/source-map-consumer' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no typing for this import :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we don't need the /lib/source-map-consumer
part, as source-map-js
main module exports SourceMapConsumer
too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is done on purpose to reduce bundle size.
source-map-js is a js fork with applied optimisations comparable with rust optimisation in latest source-map versions. Staying on js allows us to bundle package and not increase install size. As a bonus I added support for importing from lib directly so we could avoid bundling whole package. See 7rulnik/source-map-js#13 ``` du -ck dist/node ``` before: 4164 kB after: 4140 kB
Description
source-map-js is a js fork with applied optimisations comparable with
rust optimisation in latest source-map versions.
Staying on js allows us to bundle package and not increase install size.
As a bonus I added support for importing from lib directly so we could
avoid bundling whole package. See 7rulnik/source-map-js#13
before: 4164 kB
after: 4140 kB
Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).