storefront-ui icon indicating copy to clipboard operation
storefront-ui copied to clipboard

[nuxt] Module improvement suggestions

Open pi0 opened this issue 4 years ago • 1 comments

Hi there! Here are few suggestions to improve nuxt module for adding to nuxt module listing (https://github.com/nuxt/modules/pull/187):

Checking currnet version:

  • Please try to migrate to ESM syntax and avoid CommonJS for future compatibility.
  • You can use defu and remove 1MB lodash dependency for merging defaults that will also have consistent behavior with upcoming nuxt kit API
  • Instead of using extendBuild + config.resolve.alias which is webpack-only, you can directly extend this.options.build.alias
  • For using require.resolve, use [nuxt.options.rootDir, __dirname, process.cwd()] since @storefront-ui/vue is a dependency of your module not necessarily in the current working directory and same for rootDIr that is not always cwd.
  • Add explicit depenency @storefront-ui/shared to module dependencies (or make it/both peedDependencies asking user to explicitly install). Implicitly depending on node_modules can break pnpm and plug-an-play behavior

cc @Baroshem

┆Issue is synchronized with this Jira Zadanie by Unito

pi0 avatar Oct 04 '21 15:10 pi0

Moving to 11.3 as it requires some more complex testing and research on new options we can add

aniamusial avatar Nov 04 '21 09:11 aniamusial

Hey @pi0 we are currently in LTS phase with SFUI 1.0 as we work on recently released SFUI 2.0 - https://docs.vuestorefront.io/v2/, therefore I am closing the issue. Thank you for reporting and please let us know what you think about the new version! :)

aniamusial avatar Jun 15 '23 15:06 aniamusial