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

Addon v2 should always use relative paths for own files #180

Merged

Conversation

mkszepp
Copy link
Contributor

@mkszepp mkszepp commented Jul 2, 2024

As defined in RFC of V2 addons, we should always use relative urls inside addon for own scripts

https://rfcs.emberjs.com/id/0507-embroider-v2-package-format/

Own Javascript: Imports
Modules in Own Javascript are allowed to use ECMA static import and dynamic import() to resolve any allowed dependency, causing it to be included in the build whenever the importing module is included. This replaces app.import. Resolution follows prevailing Node rules. (This usually means the node_modules algorithm, but it could also mean Yarn PnP. The difference shouldn't matter if you are correctly declaring all your allowed dependencies.)
Notice that a package’s allowed dependencies do not include the package itself. This is consistent with how Node resolution works. To import files from within your own package you must use relative paths. This is different from how run-time AMD module resolution has historically worked in Ember Apps. (@embroider/compat implements automatic adjustment for this case when compiling from v1 to v2).

reverts #178

@RobbieTheWagner RobbieTheWagner merged commit 2aecb71 into minutebase:master Jul 8, 2024
13 checks passed
@mkszepp mkszepp deleted the revert-178-use-relative-paths branch July 8, 2024 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants