The Wayback Machine - http://web.archive.org/web/20220322085753/https://github.com/AssemblyScript/assemblyscript/pull/2096
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

fix: transform cannot find module #2096

Merged
merged 5 commits into from Nov 11, 2021
Merged

fix: transform cannot find module #2096

merged 5 commits into from Nov 11, 2021

Conversation

mooooooi
Copy link
Contributor

@mooooooi mooooooi commented Oct 14, 2021

Environment:
assemblyscript: 0.19.17
platform: macos
cmd: yarn asbuild
asconfig:

{
    // ...someting not important
    options: {
        "transform": "./transform.ts"
    }
}

The segment of options.js

function resolvePath(p, baseDir, useNodeResolution = false) {
  if (path.isAbsolute(p)) return p;
  if (useNodeResolution && !p.startsWith(".")) {
    return dynrequire.resolve(p, { paths: [ baseDir ] });
  }
  return path.join(baseDir, p);
}

The default value of baseDir is .. When p is relative path, then ...

path.join(".", "./transform.ts"); // The result is 'transform.ts'. It lost the information about relative
  • I've read the contributing guidelines
  • I've added my name and email to the NOTICE file

cli/util/options.js Outdated Show resolved Hide resolved
@mooooooi mooooooi requested a review from dcodeIO Oct 23, 2021
@mooooooi
Copy link
Contributor Author

@mooooooi mooooooi commented Oct 29, 2021

Is there any another problem? @dcodeIO

@dcodeIO dcodeIO merged commit 341cb9d into AssemblyScript:main Nov 11, 2021
9 checks passed
@dcodeIO
Copy link
Member

@dcodeIO dcodeIO commented Nov 11, 2021

Thank you! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants