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

Sourcemap url #218

Merged
merged 3 commits into from
May 22, 2022
Merged

Sourcemap url #218

merged 3 commits into from
May 22, 2022

Conversation

hildjj
Copy link
Contributor

@hildjj hildjj commented Nov 23, 2021

Add //# sourceMappingURL= to generated JS files from the CLI only. Use the magic filename inline to get an inline sourceMap, like rollup does.

For the infrequent use case when people want to use an HTTP SourceMap: header, prefix the output file with hidden:.

@hildjj hildjj mentioned this pull request Nov 23, 2021
15 tasks
@hildjj
Copy link
Contributor Author

hildjj commented Nov 28, 2021

Easiest way to look at this is npm run coverage, then look at the coverage maps. You'll see coverage over the JS portions of the grammar file.

Copy link
Member

@Mingun Mingun left a comment

Choose a reason for hiding this comment

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

LGTM with keeping in mind #215 feedback and small fixes in the documentation here

Comment on lines 191 to 200
<dt><code>-m</code>, <code>--source-map &lt;file&gt;</code></dt>
<dd>Generate a source map. If name is not specified, the source map will be
named "<input_file>.map" if input is a file and "source.map" if input is a
standard input. If the special filename 'inline' is given, the sourcemap
will be embedded in the output file as a data URI. If the filename is
prefixed with `hidden:`, no mapping URL will be included so that the mapping
can be specified with an HTTP SourceMap: header. This option conflicts with
the `-t/--test` and `-T/--test-file` options unless `-o/--output` is also
specified</dd>
Copy link
Member

Choose a reason for hiding this comment

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

Just minor formatting fix:

Suggested change
<dt><code>-m</code>, <code>--source-map &lt;file&gt;</code></dt>
<dd>Generate a source map. If name is not specified, the source map will be
named "<input_file>.map" if input is a file and "source.map" if input is a
standard input. If the special filename 'inline' is given, the sourcemap
will be embedded in the output file as a data URI. If the filename is
prefixed with `hidden:`, no mapping URL will be included so that the mapping
can be specified with an HTTP SourceMap: header. This option conflicts with
the `-t/--test` and `-T/--test-file` options unless `-o/--output` is also
specified</dd>
<dt><code>-m</code>, <code>--source-map &lt;file&gt;</code></dt>
<dd>Generate a source map. If name is not specified, the source map will be
named "&lt;input_file&gt;.map" if input is a file and "source.map" if input is a
standard input. If the special filename <code>inline</code> is given, the sourcemap
will be embedded in the output file as a data URI. If the filename is
prefixed with <code>hidden:</code>, no mapping URL will be included so that the mapping
can be specified with an HTTP SourceMap: header. This option conflicts with
the <code>-t/--test</code> and <code>-T/--test-file</code> options unless <code>-o/--output</code> is also
specified</dd>

@hildjj
Copy link
Contributor Author

hildjj commented May 21, 2022

Rebased, and included your change above. @Mingun could you take a quick look at this before I land it, please?

Copy link
Member

@Mingun Mingun left a comment

Choose a reason for hiding this comment

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

All ok now

@hildjj hildjj merged commit 92b937e into peggyjs:1.3 May 22, 2022
@hildjj hildjj deleted the sourcemap-url branch May 22, 2022 17:35
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.

2 participants