-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Improve documentation on devtool #1533
Conversation
content/configuration/devtool.md
Outdated
T> `+` means faster, `-` slower and `o` about the same time | ||
|
||
Some of these values are suited for development and some for production. For development you typically want fast Source Maps at the cost of bundle size, but for production you want separate Source Maps that are accurate. | ||
T> Instead of using the `devtool` option you can also use the `SourceMapDevToolPlugin`/`EvalSourceMapDevToolPlugin` directly. It has more options. You must never use both `devtool` option and plugin! |
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.
T> Instead of using the devtool
option you can also use SourceMapDevToolPlugin
/EvalSourceMapDevToolPlugin
directly as it has more options. Never use both the devtool
option and plugin together.
content/configuration/devtool.md
Outdated
T> `+` means faster, `-` slower and `o` about the same time | ||
|
||
Some of these values are suited for development and some for production. For development you typically want fast Source Maps at the cost of bundle size, but for production you want separate Source Maps that are accurate. | ||
T> Instead of using the `devtool` option you can also use the `SourceMapDevToolPlugin`/`EvalSourceMapDevToolPlugin` directly. It has more options. You must never use both `devtool` option and plugin! |
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.
@sokra Can we say why someone shouldn't use them together?
content/configuration/devtool.md
Outdated
hidden-source-map | -- | -- | yes | original source | ||
nosources-source-map | -- | -- | yes | without source content | ||
|
||
T> `+++` super fast, `++` pretty fast, `+` fast, `o` medium, `-` slow, `--` pretty slow |
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.
@sokra You had a previous commit that used very fast
, I think that's actually better, as 'pretty' would typically be one before 'fast'.
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.
The CI didn't allowed me to use very
.
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.
Interesting, I guess it labels it as a 'weasel word', which is kind of true, but an indication there are times you might want it 😆 .
Thanks!
content/configuration/devtool.md
Outdated
|
||
W> There are some issues with Source Maps in Chrome. [We need your help!](https://github.com/webpack/webpack/issues/3165). | ||
|
||
T> See [`output.sourceMapFilename`](/configuration/output#output-sourcemapfilename) to customize the filenames of generated Source Maps. | ||
|
||
### Qualities |
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.
@sokra Can we add a line break between the explanation and the examples?
content/configuration/devtool.md
Outdated
|
||
`hidden-source-map` - Same as `source-map`, but doesn't add a reference comment to the bundle. Useful if you only want SourceMaps to map error stack traces from error reports, but don't want to expose your SourceMap for the browser development tools. | ||
`source-map` - A full SourceMap is emitted as a separate file. It adds a reference comment to the bundle so development tools know where to find it. Warning: You should configure your server to disallow access to the Source Map file for normal users! |
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.
@sokra Could we add a line break between the explanation and the warning? Ideally this would be formatted differently, but we'll worry about that later.
content/configuration/devtool.md
Outdated
|
||
`cheap-source-map` - A SourceMap without column-mappings ignoring loaded Source Maps. | ||
`hidden-source-map` - Same as `source-map`, but doesn't add a reference comment to the bundle. Useful if you only want SourceMaps to map error stack traces from error reports, but don't want to expose your SourceMap for the browser development tools. Warning: You should not deploy the Source Map file to the webserver. Instead only use it for error report tooling. |
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.
@sokra Could we add a line break between the explanation and the warning? Ideally this would be formatted differently, but we'll worry about that later.
content/configuration/devtool.md
Outdated
|
||
`cheap-module-source-map` - A SourceMap without column-mappings that simplifies loaded Source Maps to a single mapping per line. | ||
`nosources-source-map` - A SourceMap is created without the `sourcesContent` in it. It can be used to map stack traces on the client without exposing all of the source code. You can deploy the Source Map file to the webserver. Warning: It still exposes filenames and structure for decompiling, but it doesn't expose the original code. |
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.
@sokra Could we add a line break between the explanation and the warning? Ideally this would be formatted differently, but we'll worry about that later.
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.
Hey @sokra I'm working with the Webpack docs to improve and polish language as much as possible, here are a few suggestions…
Thanks for the contribution.
@ChrisChinchilla Thanks for your feedback. |
content/configuration/devtool.md
Outdated
`source-map` - A full SourceMap is emitted as a separate file. It adds a reference comment to the bundle so development tools know where to find it. | ||
|
||
W> You should configure your server to disallow access to the Source Map file for normal users! |
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.
@ChrisChinchilla we actually can format them differently (as @sokra did here). We have custom markdown syntax enabled so that you can use W>
for a warning, T>
for a tip, and ?>
for a TODO. I think this is mentioned in the writer's guide but if it's not feel free to submit a PR.
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.
@sokra awesome work and @ChrisChinchilla thanks for reviewing! I think this one also resolves #273.
I'm going to work on resolving the conflicts here and in the other approved PRs as soon as I get some time so we can get these things merged. They're due to the major restructuring from #1490. |
ecb90ce
to
3a412fc
Compare
@sokra merged, you should be able to close those issues on the main repo now. (it doesn't seem like the "fixes" keyword works across repos unfortunately, although maybe there's good reason for that) |
fixes webpack/webpack#2725
fixes webpack/webpack#4936
fixes webpack/webpack#2766
fixes webpack/webpack#2145
fixes webpack/webpack#1689
fixes #273