Add files list option
This commit is contained in:
1 parent
8b06fe6059
commit
b5ecd09185
2 files changed
+23
-1
No files matched your search
@@ -381,6 +381,28 @@ fn build_assets(config: &CrateConfig) -> Result<()> {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if tab.contains_key("files") && tab.get("files").unwrap().is_array() {
|
||||
// check files list.
|
||||
let list = tab.get("files").unwrap().as_array().unwrap();
|
||||
for i in list {
|
||||
if i.is_str() {
|
||||
let path = i.as_str().unwrap();
|
||||
let path = PathBuf::from(path);
|
||||
let path = config.asset_dir.join(path);
|
||||
if path.is_file() {
|
||||
sass.call(
|
||||
"sass",
|
||||
vec![
|
||||
path.to_str().unwrap(),
|
||||
path.parent().unwrap().join(format!(
|
||||
"{}.css",
|
||||
path.file_stem().unwrap().to_str().unwrap()
|
||||
)).to_str().unwrap(),
|
||||
],
|
||||
)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user