fn copy_static_aliases(&self, dest: &str) -> Result<(), Arc<Error>> {
        // Loop through any static aliases and copy them in too
        // Unlike with the server, these could override pages!
        // We'll copy from the alias to the path (it could be a directory or a file)
        // Remember: `alias` has a leading `/`!
        for (alias, path) in &self.static_aliases {
            let from = PathBuf::from(path);
            let to_str = format!("{}{}", dest, alias);
            let to = PathBuf::from(&to_str);
            // If the alias is nested, we might need to create directories
            if to_str.contains('/') {
                // This is guaranteed to be `Some()`, since there is at least the `dist/`
                // directory
                let parent = to.parent().unwrap();
                if !parent.exists() {
                    if let Err(err) = fs::create_dir(parent) {
                        let err = EngineError::NestedStaticAliasDirCreationFailed {
                            source: err,
                            alias: alias.to_string(),
                        };
                        let err: Arc<Error> = Arc::new(err.into());
                        self.plugins
                            .functional_actions
                            .export_actions
                            .after_failed_nested_static_alias_dir_creation
                            .run(err.clone(), self.plugins.get_plugin_data())
                            .map_err(|err| Arc::new(err.into()))?;
                        return Err(err);
                    }
                }
            }

            if from.is_dir() {
                if let Err(err) = copy_dir(&from, &to, &CopyOptions::new()) {
                    let err = EngineError::CopyStaticAliasDirErr {
                        source: err,
                        to: to_str,
                        from: path.to_string(),
                    };
                    let err: Arc<Error> = Arc::new(err.into());
                    self.plugins
                        .functional_actions
                        .export_actions
                        .after_failed_static_alias_dir_copy
                        .run(err.clone(), self.plugins.get_plugin_data())
                        .map_err(|err| Arc::new(err.into()))?;
                    return Err(err);
                }
            } else if let Err(err) = fs::copy(&from, &to) {
                let err = EngineError::CopyStaticAliasFileError {
                    source: err,
                    to: to_str,
                    from: path.to_string(),
                };
                let err: Arc<Error> = Arc::new(err.into());
                self.plugins
                    .functional_actions
                    .export_actions
                    .after_failed_static_alias_file_copy
                    .run(err.clone(), self.plugins.get_plugin_data())
                    .map_err(|err| Arc::new(err.into()))?;
                return Err(err);
            }
        }

        Ok(())
    }
Copies the static aliases into a distribution directory at `dest` (no
trailing `/`). This should be the root of the destination directory for
the exported files. Because this provides a customizable
destination, it is fully engine-agnostic.

The error type here is a tuple of the location the asset was copied
from, the location it was copied to, and the error in that process
(which could be from `io` or `fs_extra`).
packages/perseus/src/turbine/export.rs