Skip to content
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

[Bug report] Can't use relative path for local theme #51

Closed
bcorcoran opened this issue Feb 2, 2021 · 2 comments
Closed

[Bug report] Can't use relative path for local theme #51

bcorcoran opened this issue Feb 2, 2021 · 2 comments

Comments

@bcorcoran
Copy link

I'm trying to create a Vuepress next site and running into a roadblock.

I can only specify a path to the local theme (<repo>/.vuepress/theme) by using an absolute path... this poses a problem because the path to the theme is different on my machine than another developer's.

Why doesn't this work in .vuepress/config.js?

module.exports = {
     theme: '.vuepress/theme',
}

or

module.exports = {
     theme: './theme',
}
@meteorlxy
Copy link
Member

path.resolve(__dirname, '....')

@bcorcoran
Copy link
Author

bcorcoran commented Feb 2, 2021

Ok, so for anyone looking for the same thing:

in .vuepress/config.js

var path = require('path')

module.exports = {
  theme: path.resolve(__dirname, 'theme'),
}

This should be documented as the default way to include a local theme. Absolute paths don't make sense in... any scenario I can think of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants