Node.js API #83
-
Has anyone tried implementing using the node.js API. I know is not documented yet but similar to v1 (https://vuepress.vuejs.org/api/node.html#usage) we should be able to do something like this:
When I try this I get errors like this:
Am I missing something here? Am I wrong in assuming that this would work similarly to how it did in v1? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
The problem only seems to exist when using the webpack bundler. After switching to Vite the issue is gone. I'm probably missing something obvious here but I thought I'd share those findings in case anyone else is struggling with this issue. |
Beta Was this translation helpful? Give feedback.
-
I think you must have read the code in But that could be a potential issue of --- updated This should be fixed in accc484, but you still need to set |
Beta Was this translation helpful? Give feedback.
I think you must have read the code in
@vuepress/cli
, and you are likely missing the following snippet:https://github.com/vuepress/vuepress-next/blob/f8cd4a37d251e64ded2f1d7e8ca51afd81fd72d9/packages/%40vuepress/cli/src/commands/build/build.ts#L20-L22
But that could be a potential issue of
@vuepress/bundler-webpack
.--- updated
This should be fixed in accc484, but you still need to set
NODE_ENV=production
to enable production mode.