Skip to content

allow passing of js file name in bundled mode (for renaming main.js) #8

@Fishrock123

Description

@Fishrock123

This should allow a different entry other than main.js and use the parent path of that as the bundle file, in both disk and zip-bundle mode.

This used to work but some things needed changing for bundled mode to work, the relevant code is at

rustyduk/src/main.rs

Lines 153 to 170 in 3797dd1

let entry_file: String = "main.js".to_owned();
// TODO(Fishrock123): support renaming of main.js
// If there are free arguments (i.e. not an option or past `--`)
// if !matches.free.is_empty() {
// let possible_entry = matches.free[0].clone();
// If we we passed a .js file,
// if Path::new(&possible_entry).ends_with(".js") {
// entry_file = possible_entry;
// } else {
resource::check_set_zip(&base_path);
// }
// }
duk::push_string(ctx, "nucleus.dofile('");
duk::push_lstring(ctx, entry_file);
and entry_file is the variable that should be altered.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions