Skip to content

module-alias support #67

Open
Open
@ZollieDev

Description

@ZollieDev

I've been unable to get extendscriptr to run in tandem with module-alias. My application is just the boilerplate, and I'd like to add module-alias so that I can better manage require paths as the application scales. Open to suggestions if I'm headed down an odd path or if this is the wrong communication channel. Thanks for taking the time.

app.js

// this errors when the jsx is run
require('module-alias/register')
$.writeln("@test")

// this runs, but "@test2" will be printed rather than "test2", suggesting moduleAlias didn't do its thing
const moduleAlias = require('module-alias')
moduleAlias.addAlias("@test2", "test2")
$.writeln("@test2")

package.json

{
    "scripts": {
        "setup": "mkdir dist ; touch dist/app.jsx",
        "build": "extendscriptr --script ./src/app.js --output ./dist/app.jsx"
    },
    "devDependencies": {
        "extendscriptr": "^1.2.6"
    },
    "dependencies": {
        "module-alias": "^2.2.2"
    },
    "_moduleAliases": {
        "@test": "test"
    }
}

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