Skip to content

require() is not working for local scripts #90

@sh-dave

Description

@sh-dave

Currently it's not possible to require local scripts from within khafile.js.

khafile.js

const myscript = require('./myscript.js');
let project = new Project('xxx');
...
Creating Kha project.
{ Error: Cannot find module './myscript.js'
...

I guess this is due to how the projectfile is run in https://github.com/KTXSoftware/khamake/blob/master/src/ProjectFile.ts#L24
as it only gets very limited access to anything from the executing script.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions