In my experience, this issue might also arise in other frameworks with plugin/component ecosystems that rely on specific build tools (such as React components with JSX). While Vue serves as my use-case.
Having developed numerous Vue components as single .vue
files published on NPM, I have not listed any dependencies in the package.json
. These components are designed to operate within a parent project utilizing webpack, vue-loader, sass-loader, and similar tools. You can find an example of such a component here.
I am uncertain about the appropriate method for stating that these components require the parent package to have these build tools. Placing them under devDependencies
does not seem right since the components themselves do not depend on these tools during development. While it appears that peerDependencies
could be more suitable, I still harbor doubts regarding its compatibility with my intentions.
After browsing through various components on the awesome-vue repository, there seems to be no usage of peerDependencies
, and the listed devDependencies
pertain to the individual components' development process.
What would be the correct approach when authoring these components? It's almost as if a "peerDevDependencies
" category is needed.