Skip to content

Define custom component directory and import custom components #729

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

Closed
olavoasantos opened this issue Aug 11, 2018 · 2 comments
Closed

Define custom component directory and import custom components #729

olavoasantos opened this issue Aug 11, 2018 · 2 comments
Labels
version: next Planned to do or already included in the next(1.0.0) version

Comments

@olavoasantos
Copy link

olavoasantos commented Aug 11, 2018

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?

  • Custom component directory:

carbon 25

  • Custom component import:

carbon 24

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.

Are you willing to work on this yourself?**

Yes. #730

@ulivz ulivz added version: next Planned to do or already included in the next(1.0.0) version 1.0.0 labels Aug 11, 2018
@ulivz
Copy link
Member

ulivz commented Aug 11, 2018

#730 (comment)

@ulivz
Copy link
Member

ulivz commented Aug 11, 2018

docs of WIP plugin @vuepress/plugin-register-components.

@ulivz ulivz removed the 1.0.0 label Aug 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
version: next Planned to do or already included in the next(1.0.0) version
Projects
None yet
Development

No branches or pull requests

2 participants