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(module): remove deprecated resolveModule #2298

Merged
merged 1 commit into from Sep 11, 2023
Merged

Conversation

farnabaz
Copy link
Member

@farnabaz farnabaz commented Sep 7, 2023

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@netlify
Copy link

netlify bot commented Sep 7, 2023

βœ… Deploy Preview for nuxt-content canceled.

Name Link
πŸ”¨ Latest commit 472b920
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt-content/deploys/64fa549dc7fb11000892c503

@@ -307,7 +306,7 @@ export default defineNuxtModule<ModuleOptions>({
},
async setup (options, nuxt) {
const { resolve } = createResolver(import.meta.url)
const resolveRuntimeModule = (path: string) => resolveModule(path, { paths: resolve('./runtime') })
const resolveRuntimeModule = (path: string) => resolve('./runtime', path)
Copy link
Member

@pi0 pi0 Sep 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that resolve just joint paths. It doesn't check extensions and they are not alternatives. You might want to use resolver.resolePath but have to try

Copy link
Member Author

@farnabaz farnabaz Sep 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK almost in every case of our usages Nuxt takes care of the extension matching and module works fine with resolve function

Am I wrong about extension matching?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to rely on that (and it works with published module) surely!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested the build in a real project and it's fine. Will merge and check on edge channel too.
Thanks

@farnabaz farnabaz merged commit 1cebdab into main Sep 11, 2023
7 checks passed
@farnabaz farnabaz deleted the fix/remove-resolveModule branch September 11, 2023 13:44
@farnabaz farnabaz mentioned this pull request Sep 26, 2023
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.

None yet

2 participants