storefront-ui
storefront-ui copied to clipboard
[nuxt] Module improvement suggestions
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.aliaswhich is webpack-only, you can directly extendthis.options.build.alias - For using
require.resolve, use [nuxt.options.rootDir,__dirname, process.cwd()] since@storefront-ui/vueis 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/sharedto module dependencies (or make it/both peedDependencies asking user to explicitly install). Implicitly depending onnode_modulescan break pnpm and plug-an-play behavior
cc @Baroshem
┆Issue is synchronized with this Jira Zadanie by Unito
Moving to 11.3 as it requires some more complex testing and research on new options we can add
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! :)