Renovamen / vuepress-theme-gungnir

A blog theme for VuePress 2.
https://v2-vuepress-theme-gungnir.vercel.app
Apache License 2.0
362 stars 79 forks source link

Can't build the website with vite #88

Closed darkRaspberry closed 2 years ago

darkRaspberry commented 2 years ago

✅ Checklist

🔎 Description

Concise Description

I was trying to build the blog with vite, by using vuepress build docs

Expected behavior

project can be build using vite and doesn't need to webpack

Steps to reproduce

vuepress build docs

Screenshots or Screen Recording (if possible)

$~ pnpm docs:build

> darkblogger@1.0.0 docs:build /home/dev/github/www-blog
> vuepress build docs

info Initializing VuePress and preparing data...
⠴ Compiling with vite[vite]: Rollup failed to resolve import "@vuepress/client" from "docs/.vuepress/client.ts".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
✖ Compiling with vite - failed
[vite]: Rollup failed to resolve import "@vuepress/client" from "docs/.vuepress/client.ts".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
Error: [vite]: Rollup failed to resolve import "@vuepress/client" from "docs/.vuepress/client.ts".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
    at onRollupWarning (/home/dev/github/www-blog/node_modules/.pnpm/vite@2.9.15_sass@1.54.5/node_modules/vite/dist/node/chunks/dep-689425f3.js:41797:19)
    at onwarn (/home/dev/github/www-blog/node_modules/.pnpm/vite@2.9.15_sass@1.54.5/node_modules/vite/dist/node/chunks/dep-689425f3.js:41613:13)
    at Object.onwarn (/home/dev/github/www-blog/node_modules/.pnpm/rollup@2.77.3/node_modules/rollup/dist/shared/rollup.js:23216:13)
    at ModuleLoader.handleResolveId (/home/dev/github/www-blog/node_modules/.pnpm/rollup@2.77.3/node_modules/rollup/dist/shared/rollup.js:22466:26)
    at /home/dev/github/www-blog/node_modules/.pnpm/rollup@2.77.3/node_modules/rollup/dist/shared/rollup.js:22427:26
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
 ELIFECYCLE  Command failed with exit code 1.

📄 Environment info (npx vuepress info)

System:
    OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
    CPU: (4) x64 Intel(R) Core(TM) i3-6006U CPU @ 2.00GHz
    Memory: 3.44 GB / 7.57 GB
    Shell: 3.5.1 - /usr/bin/fish
  Binaries:
    Node: 18.6.0 - ~/.nodenv/versions/18.6.0/bin/node
    Yarn: 1.22.19 - ~/.nodenv/versions/18.6.0/bin/yarn
    npm: 8.17.0 - ~/.nodenv/versions/18.6.0/bin/npm
  Utilities:
    Git: 2.37.3 - /usr/bin/git
  Browsers:
    Chrome: 105.0.5195.102
    Firefox: 104.0.2
  npmPackages:
    @vuepress/bundler-vite: Not Found
    @vuepress/bundler-webpack: Not Found
    @vuepress/cli: Not Found
    @vuepress/client: Not Found
    @vuepress/core: Not Found
    @vuepress/markdown: Not Found
    @vuepress/plugin-active-header-links: Not Found
    @vuepress/plugin-back-to-top: Not Found
    @vuepress/plugin-container: Not Found
    @vuepress/plugin-docsearch: Not Found
    @vuepress/plugin-external-link-icon: Not Found
    @vuepress/plugin-git: Not Found
    @vuepress/plugin-google-analytics: Not Found
    @vuepress/plugin-medium-zoom: Not Found
    @vuepress/plugin-nprogress: Not Found
    @vuepress/plugin-palette: Not Found
    @vuepress/plugin-prismjs: Not Found
    @vuepress/plugin-pwa: Not Found
    @vuepress/plugin-pwa-popup: Not Found
    @vuepress/plugin-register-components: Not Found
    @vuepress/plugin-search: Not Found
    @vuepress/plugin-shiki: Not Found
    @vuepress/plugin-theme-data: Not Found
    @vuepress/plugin-toc: Not Found
    @vuepress/shared: Not Found
    @vuepress/theme-default: Not Found
    @vuepress/utils: Not Found
    vue: Not Found
    vue-loader: Not Found
    vue-router: Not Found
    vuepress: 2.0.0-beta.49 => 2.0.0-beta.49 
    vuepress-vite: Not Found
    vuepress-webpack: Not Found

🔗 Reproduction link / repo:

https://github.com/darkRaspberry/blog

darkRaspberry commented 2 years ago

No matter what I use I can't get that build running, I don't want to add more dependencies, Hence I don't want to add webpack.

darkRaspberry commented 2 years ago

Fixed by adding dependencies vue in my package.json. With 5 dependencies I have my blog active. Thanks so much.