pnpm support? #695
-
Just heard the news (actually in Oct 2020) that Vue, Vite and VitePress are all using pnpm instead of yarn v1 classic now. Vue: vuejs/core#4766 VuePress still recommends npm or yarn while pnpm needs a pnpm is really awesome in saving time and disk storage so I am looking forward to a native support... Anyone? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
Nope, unless we fully reshape our api. Currently api from v1 are depending on filepath heavily. So it won't work if there is acually no such files under Also, we had to drop alia support, like We have to change theme plugins to let them export a function, also use module path in all paths: Before: // .vuepress/config.ts
export default {
theme: 'hope',
themeConfig: {
// config
},
plugins: [
['blog2', {
// options
}],
}
// plugin api in vuepress-plugin-blog2 under lib/node
import { path } from '@vuepress/utils'
export default (options) => {
clientAppEnhanceFiles: path.resolve(__dirname, '../client/appEnhance.js')
} After: // .vuepress/config.ts
import { useTheme } from 'vuepress-theme-hope';
import { useBlog2 } from 'vuepress-theme-blog2';
export default {
theme: useTheme({
// themeConfig
}),
plugins: [
useBlog2({
// options
}),
]
}
// plugin api in vuepress-plugin-blog2 under lib/node
export default (options) => {
clientAppEnhanceFiles: 'vuepress-plugin-blog/lib/client/appEnhance.js'
}
// package.json for vuepress-plugin-blog2
{
...
exports: {
'./lib/client/appEnhance.js': './lib/client/appEnhance.js'
},
...
} That's a HUGE change. Also only the changes in plugin api is necssary for I once started a dicussion before, but @meteorlxy refuse it. BTW: I eager this feature as well, and I am already doing the above changes to make my theme and plugins ready. So maybe you can try to convince @meteorlxy that this change is needed. |
Beta Was this translation helpful? Give feedback.
-
It's not a good time to start this huge change after comming to |
Beta Was this translation helpful? Give feedback.
-
UPDATE: Good news, we have moved to pnpm after a huge refactor since 2.0.0-beta.40 (with lots of breaking changes though 😅 ) LEGACY ANSWER: It is inappropriate to compare vuepress with vue/vite. Also, even the vue/vite repo move to use pnpm, it does not means that users should also use pnpm, and vice versa. A similar project is slidev, which also loads themes dynamically from In brief, pnpm limits a project to load dependencies dynamically, so we have to make pnpm's behavior consistent with npm / yarn v1 to work properly. A .pnpmfile.cjs file in your project could help, but not such easy. As for VitePress, it uses a different way to load themes (like this and this), i.e. explictly install and import the theme package. It's quite different from VuePress v1 /v2 way. We could change to use that way, which will cause breaking changes for sure. In addition, VitePress also does not support vitepress-specific plugins, and users need to install and use vite plugin directly. You know, current VuePress plugin mechanism is also quite different 😞 . |
Beta Was this translation helpful? Give feedback.
-
Good news, we have moved to pnpm after a huge refactor (with lots of breaking changes though 😅 ) |
Beta Was this translation helpful? Give feedback.
Good news, we have moved to pnpm after a huge refactor (with lots of breaking changes though 😅 )