-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Global vuepress fail to resolve custom theme #392
Comments
Perhaps something like autoloading the theme folder from npm registry by fetching it would be nice or maybe change the documentation saying that if you specify a custom theme (which isn't local) you have to |
@hmatalonga Come on!
Look at the last line of the first step to repro it:
Although you add the theme locally, you cannot use it via global vuepress. I just took |
@meteorlxy my apologies, I don't known how I how missed the first steps... I removed my dumb comments from the previous message xD Anyway for using it via global vuepress does the idea of somehow fetching the theme contents makes sense to you? |
@hmatalonga In my opinion, we must consider every possible & sensible scenario |
once again, I want to emphasize the intention of Evan: VuePress is mainly for vuejs. So we don't have to think about all possible scenarios. |
@ulivz Sorry but I didn't get what you mean here. When using global vuepress, you have to make the theme global. That's unreasonable |
So I use "sensible" together. Not all possible scenarios should we consider, but those sensible ones. |
I don't think this feature is sensible. If you just want to play around with VuePress, you can install it globally. but since you have a custom theme installed at local, why not installing VuePress at local too? |
"If you just want to play around with VuePress" - and try some different themes randomly - this is sensible. Just because that we don't have various themes now |
it makes sense. |
Hi @ulivz @meteorlxy , However if I modify ~/.config/yarn/global/node_modules/vuepress/lib/prepare.js and add It fix the error, I guess it resolve the theme location within main project working directory node_modules folder, if that make sense? Thanks! |
Here's the simplest way to repro it:
vuepress-theme-vue
for example) to a new repo:src
and base files, then the directory will be like this:vue
inconfig.js
vuepress
yarn global add vuepress-theme-vue
)vuepress
locally (i.e.yarn add vuepress
) and run it locally (i.e.yarn vuepress dev src
)The cause is that we are using
require.resolve()
to resolve custom theme:vuepress/lib/prepare.js
Lines 139 to 140 in 145cf4f
Is there a better solution?
The text was updated successfully, but these errors were encountered: