We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently, we can build a theme package following https://vuepress.vuejs.org/theme/writing-a-theme.html#directory-structure
We have to set the main field of package.json to index.js.
main
package.json
index.js
If we could allow the main field be something like lib/index.js?
lib/index.js
i.e. putting all theme files into a sub directory lib:
lib
themePackageRoot ├── lib # put all the theme files in │ ├── global-components │ │ └── xxx.vue │ ├── components │ │ └── xxx.vue │ ├── layouts │ │ ├── Layout.vue │ │ └── 404.vue │ ├── styles │ │ ├── index.styl │ │ └── palette.styl │ ├── templates │ │ ├── dev.html │ │ └── ssr.html │ ├── index.js │ └── enhanceApp.js ├── docs # and some other sub directory that not related to the theme files └── package.json # point "main" to "lib/index.js"
I find related code here:
vuepress/packages/@vuepress/core/lib/prepare/loadTheme.js
Lines 178 to 180 in 6146287
Change require.resolve(`${name}/package.json`) to require.resolve(name) may help, but I'm not sure if it will cause any side effects.
require.resolve(`${name}/package.json`)
require.resolve(name)
The text was updated successfully, but these errors were encountered:
chore($core): resolve theme path to the dir of main file (close vuejs…
ec575b9
…#1204)
febe3a7
No branches or pull requests
Feature request
What problem does this feature solve?
Currently, we can build a theme package following https://vuepress.vuejs.org/theme/writing-a-theme.html#directory-structure
We have to set the
main
field ofpackage.json
toindex.js
.If we could allow the
main
field be something likelib/index.js
?i.e. putting all theme files into a sub directory
lib
:How should this be implemented in your opinion?
I find related code here:
vuepress/packages/@vuepress/core/lib/prepare/loadTheme.js
Lines 178 to 180 in 6146287
Change
require.resolve(`${name}/package.json`)
torequire.resolve(name)
may help, but I'm not sure if it will cause any side effects.The text was updated successfully, but these errors were encountered: