refactor: rename static folder
This commit is contained in:
parent
a68a00a9bd
commit
10df91adfe
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,4 +1,4 @@
|
||||
/target
|
||||
*.db*
|
||||
/static_packages/node_modules
|
||||
/static_packages/dist
|
||||
/static/node_modules
|
||||
/static/dist
|
||||
|
43
build.rs
43
build.rs
@ -1,20 +1,39 @@
|
||||
use static_files::{resource_dir, NpmBuild};
|
||||
use std::{fs::{self, copy}, path::Path};
|
||||
use std::{
|
||||
fs::{self, copy},
|
||||
path::Path,
|
||||
};
|
||||
|
||||
fn main() -> std::io::Result<()> {
|
||||
NpmBuild::new("./static_packages")
|
||||
.change_detection()
|
||||
.install()?;
|
||||
NpmBuild::new("./static").change_detection().install()?;
|
||||
|
||||
if fs::metadata(Path::new("./static_packages/dist")).is_err() {
|
||||
fs::create_dir(Path::new("./static_packages/dist"))?;
|
||||
let dist_path = Path::new("./static/dist");
|
||||
let nm_path = Path::new("./static/node_modules");
|
||||
|
||||
if fs::metadata(dist_path).is_err() {
|
||||
fs::create_dir(dist_path)?;
|
||||
}
|
||||
|
||||
copy(Path::new("./static_packages/node_modules/feather-icons/dist/feather-sprite.svg"), Path::new("./static_packages/dist/feather-sprite.svg"))?;
|
||||
copy(Path::new("./static_packages/node_modules/bulma/css/bulma.min.css"), Path::new("./static_packages/dist/bulma.min.css"))?;
|
||||
copy(Path::new("./static_packages/node_modules/htmx.org/dist/htmx.min.js"), Path::new("./static_packages/dist/htmx.min.js"))?;
|
||||
copy(Path::new("./static_packages/node_modules/htmx.org/dist/ext/response-targets.js"), Path::new("./static_packages/dist/response-targets.js"))?;
|
||||
copy(Path::new("./static_packages/brass.jpeg"), Path::new("./static_packages/dist/brass.jpeg"))?;
|
||||
copy(
|
||||
nm_path.join("feather-icons/dist/feather-sprite.svg"),
|
||||
dist_path.join("feather-sprite.svg"),
|
||||
)?;
|
||||
copy(
|
||||
nm_path.join("bulma/css/bulma.min.css"),
|
||||
dist_path.join("bulma.min.css"),
|
||||
)?;
|
||||
copy(
|
||||
nm_path.join("htmx.org/dist/htmx.min.js"),
|
||||
dist_path.join("htmx.min.js"),
|
||||
)?;
|
||||
copy(
|
||||
nm_path.join("htmx.org/dist/ext/response-targets.js"),
|
||||
dist_path.join("response-targets.js"),
|
||||
)?;
|
||||
copy(
|
||||
Path::new("./static/brass.jpeg"),
|
||||
dist_path.join("brass.jpeg"),
|
||||
)?;
|
||||
|
||||
resource_dir("./static_packages/dist").build()
|
||||
resource_dir("./static/dist").build()
|
||||
}
|
||||
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "static_packages",
|
||||
"name": "static",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
Loading…
x
Reference in New Issue
Block a user