You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow developers to use the config.js file to customize the components folder and to import components with custom names.
What problem does this feature solve?
Currently, VuePress looks for a components folder inside the .vuepress folder. If we are aiming to integrate VuePress into an existing project (or use it to document a custom component package), this would drive us to move or copy existing components to this folder. This results in either verbosity (as we would have to import from ./path/to/.vuepress/components) or duplication.
Moreover, the current implementation does not allow us to import custom components with a custom name tag, relying solely on the folder structure of the component (e.g. <Path-To-Custom-Component></Path-To-Custom-Component>.
What does the proposed API look like?
Custom component directory:
Custom component import:
How should this be implemented in your opinion?
First, modifying the resolveOptions.js to accept two new options (components and componentsDir). Then, modifying the genImport function in the codegen.js to accept these options and generate the imports based on their values.
Feature request
Allow developers to use the
config.js
file to customize the components folder and to import components with custom names.What problem does this feature solve?
Currently, VuePress looks for a
components
folder inside the.vuepress
folder. If we are aiming to integrate VuePress into an existing project (or use it to document a custom component package), this would drive us to move or copy existing components to this folder. This results in either verbosity (as we would have to import from./path/to/.vuepress/components
) or duplication.Moreover, the current implementation does not allow us to import custom components with a custom name tag, relying solely on the folder structure of the component (e.g.
<Path-To-Custom-Component></Path-To-Custom-Component>
.What does the proposed API look like?
How should this be implemented in your opinion?
First, modifying the
resolveOptions.js
to accept two new options (components
andcomponentsDir
). Then, modifying thegenImport
function in thecodegen.js
to accept these options and generate the imports based on their values.Are you willing to work on this yourself?**
Yes. #730
The text was updated successfully, but these errors were encountered: