Skip to content

fix(app-vite&webpack): properly resolve AE script paths #18003

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

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

yusufkandemir
Copy link
Member

What kind of change does this PR introduce?

  • Bugfix

Does this PR introduce a breaking change?

  • No

The PR fulfills these requirements:

  • It's submitted to the dev branch (or v[X] branch)

Other information:
Supersedes #17795

  • use / instead of join for import paths:
    • import('quasar-app-extension-foo\\dist\\index.js') is not valid. join uses the separate according to the OS
    • similar to how getPackageJson is implemented without using join
  • packagePath = (... || getPackageScriptPath(...)) would end up .../pkg-path/dist/index.js, so this.#packagePath was sometimes pointing out to src/dist, rather than the package root.
    • this.#packagePath no longer exists, so this no longer needs to be fixed with resolve(..., '..')
  • always use appDir when resolving AE scripts
  • add code comments to clarify the behavior

@DouglasCalora
Copy link

DouglasCalora commented May 13, 2025

I tested linking localy (quasar ext invoke) on projects:

  • app-vite v2: worked ✅
  • app-webpack v4: worked ✅

app-webpack v3 will no longer be supported?

Thanks for the efford!

@yusufkandemir
Copy link
Member Author

Thanks for confirming. I am hoping for another confirmation, especially from someone using Windows.

app-vite v1 and app-webpack v3 are legacy now, we won't be making more updates to them.

@eliasassuncao
Copy link

I also tested linking locally (quasar ext invoke) on Windows with the following projects:

  • app-vite v2: worked ✅
  • app-webpack v4: worked ✅

Thanks for the support!

@DouglasCalora
Copy link

Note: I did not tested this by adding extension without linkin it localy.

On app-webpack v3, I just changed to this code:

    return getPackageScriptPath(
      this.packageFullName,
      scriptName,
      appPaths.appDir
    )

And worked the link.

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

Successfully merging this pull request may close these issues.

3 participants