Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module-alias support #67

Open
ZollieDev opened this issue Apr 29, 2021 · 0 comments
Open

module-alias support #67

ZollieDev opened this issue Apr 29, 2021 · 0 comments

Comments

@ZollieDev
Copy link

ZollieDev commented Apr 29, 2021

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"
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant