Add minification process
This commit is contained in:
parent
c8a3ec1ce6
commit
4b14573d50
5 changed files with 53 additions and 18 deletions
|
@ -46,6 +46,7 @@ extern crate test as testing;
|
|||
extern crate rustc_errors as errors;
|
||||
extern crate pulldown_cmark;
|
||||
extern crate tempdir;
|
||||
extern crate minifier;
|
||||
|
||||
extern crate serialize as rustc_serialize; // used by deriving
|
||||
|
||||
|
@ -297,6 +298,11 @@ pub fn opts() -> Vec<RustcOptGroup> {
|
|||
"How errors and other messages are produced",
|
||||
"human|json|short")
|
||||
}),
|
||||
unstable("disable-minification", |o| {
|
||||
o.optflag("",
|
||||
"disable-minification",
|
||||
"Disable minification applied on JS files")
|
||||
}),
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -478,6 +484,7 @@ pub fn main_args(args: &[String]) -> isize {
|
|||
let linker = matches.opt_str("linker").map(PathBuf::from);
|
||||
let sort_modules_alphabetically = !matches.opt_present("sort-modules-by-appearance");
|
||||
let resource_suffix = matches.opt_str("resource-suffix");
|
||||
let enable_minification = !matches.opt_present("disable-minification");
|
||||
|
||||
let edition = matches.opt_str("edition").unwrap_or("2015".to_string());
|
||||
let edition = match edition.parse() {
|
||||
|
@ -521,7 +528,8 @@ pub fn main_args(args: &[String]) -> isize {
|
|||
css_file_extension,
|
||||
renderinfo,
|
||||
sort_modules_alphabetically,
|
||||
themes)
|
||||
themes,
|
||||
enable_minification)
|
||||
.expect("failed to generate documentation");
|
||||
0
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue