Add option to generate sourcemaps #5

Merged
nmanandhar merged 2 commits from sourcemap into main 2022-02-05 10:55:17 +01:00
nmanandhar commented 2022-01-31 13:02:23 +01:00 (Migrated from github.com)
No description provided.
nmanandhar (Migrated from github.com) reviewed 2022-02-01 08:35:00 +01:00
nmanandhar (Migrated from github.com) commented 2022-02-01 08:35:00 +01:00

Instead of assuming the source map for a file is the same as the name of file with a .map extension, a more general approach would be to scan the code for sourceMapping comment to extract the sourcemap file, for eg using ( source-map-resolve). I went with the current approach as it is simple and performant and seems to work perfectly fine for this case

Instead of assuming the source map for a file is the same as the name of file with a .map extension, a more general approach would be to scan the code for sourceMapping comment to extract the sourcemap file, for eg using ([ source-map-resolve](https://github.com/lydell/source-map-resolve)). I went with the current approach as it is simple and performant and seems to work perfectly fine for this case
marijnh (Migrated from github.com) reviewed 2022-02-04 14:29:05 +01:00
marijnh (Migrated from github.com) commented 2022-02-04 14:29:05 +01:00

(Nit pick: please put a space after the type declaration colon.)

(Nit pick: please put a space after the type declaration colon.)
marijnh (Migrated from github.com) reviewed 2022-02-04 14:29:46 +01:00
marijnh (Migrated from github.com) commented 2022-02-04 14:29:46 +01:00

Could you make the last argument an options object, with generateSourceMap being the only option right now? That way the function signature doesn't become a mess if we ever add more options.

Could you make the last argument an options object, with `generateSourceMap` being the only option right now? That way the function signature doesn't become a mess if we ever add more options.
marijnh (Migrated from github.com) reviewed 2022-02-04 14:32:13 +01:00
marijnh (Migrated from github.com) commented 2022-02-04 14:32:13 +01:00

This could also take an options object as third argument. And please put spaces after commas and around operators.

This could also take an options object as third argument. And please put spaces after commas and around operators.
marijnh commented 2022-02-04 14:32:36 +01:00 (Migrated from github.com)

Looks good—I've added some small style comments.

Looks good—I've added some small style comments.
nmanandhar commented 2022-02-05 06:28:42 +01:00 (Migrated from github.com)

I have made changes based on the feedback from the review.

I have made changes based on the feedback from the review.
marijnh commented 2022-02-05 10:55:29 +01:00 (Migrated from github.com)

Merged and released as 0.1.14

Merged and released as 0.1.14
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
codemirror/buildhelper!5
No description provided.