Skip to content

Improve documentation on devtool #1533

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

Merged
merged 4 commits into from
Aug 24, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wording and formating
  • Loading branch information
sokra authored and skipjack committed Aug 24, 2017
commit 6c3c76f7291e65f81ee8492726f7ca3357204622
15 changes: 11 additions & 4 deletions src/content/configuration/devtool.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Choose a style of [source mapping](http://blog.teamtreehouse.com/introduction-so

T> The webpack repository contains an [example showing the effect of all `devtool` variants](https://github.com/webpack/webpack/tree/master/examples/source-map). Those examples will likely help you to understand the differences.

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!
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. The `devtool` option adds the plugin internally so you would end up with the plugin applied twice.

devtool | build | rebuild | production | quality
------------------------------ | ----- | ------- | ---------- | -----------------------------
Expand All @@ -52,6 +52,7 @@ W> There are some issues with Source Maps in Chrome. [We need your help!](https:

T> See [`output.sourceMapFilename`](/configuration/output#output-sourcemapfilename) to customize the filenames of generated Source Maps.


### Qualities

`bundled code` - You see all generated code as a big blob of code. You don't see modules separated from each other.
Expand Down Expand Up @@ -100,10 +101,16 @@ These options are typically used in production:

`(none)` (Omit the `devtool` option) - No SourceMap is emitted. This is a good option to start with.

`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!
`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!

`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.

W> You should not deploy the Source Map file to the webserver. Instead only use it for error report tooling.

`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.
`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.

`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.
W> It still exposes filenames and structure for decompiling, but it doesn't expose the original code.

T> When using the `uglifyjs-webpack-plugin` you must provide the `sourceMap: true` option to enable SourceMap support.