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

Stabilise disable minification #56359

Closed
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 6 additions & 0 deletions src/doc/rustdoc/src/command-line-arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,3 +359,9 @@ This flag allows rustdoc to treat your rust code as the given edition. It will c
the given edition as well. As with `rustc`, the default edition that `rustdoc` will use is `2015`
(the first edition).

### `disable-minification`: prevent minification of CSS and JS files

By default, all JS and CSS files are minified in order to make them smaller. However,
sometimes there are bugs in the minification process, or the files are harder to read
when this happens. Passing this flag to rustdoc skips the minifier, passing the original
JS and CSS all the way into the final output.
2 changes: 1 addition & 1 deletion src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ fn opts() -> Vec<RustcOptGroup> {
"How errors and other messages are produced",
"human|json|short")
}),
unstable("disable-minification", |o| {
stable("disable-minification", |o| {
o.optflag("",
"disable-minification",
"Disable minification applied on JS files")
Expand Down
10 changes: 10 additions & 0 deletions src/test/rustdoc/disable-minification.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// compile-flags:--disable-minification

// @has search-index.js
// @!has - 'var R'

/// The quick brown fox jumps over the lazy dog.
pub struct SomeStruct;

/// The quick brown fox jumps over the lazy dog.
pub fn some_fn() {}