MellowCo / unocss-preset-weapp

unocss preset for wechat miniprogram,unocss小程序预设,在 taro uniapp 原生小程序 中使用unocss
https://playful-gumption-4bb42b.netlify.app
MIT License
380 stars 35 forks source link

uniapp vue3 + unocss安装完毕后,启动项目报错 #161

Closed yyjiugui closed 1 month ago

yyjiugui commented 1 month ago
X [ERROR] Could not resolve "@unocss/core"  

    node_modules/unocss/dist/index.mjs:1:14:
      1 │ export * from '@unocss/core';     
        ╵               ~~~~~~~~~~~~~~      

  You can mark the path "@unocss/core" as external to exclude it from the bundle, which will remove
  this error and leave the unresolved path in the bundle.

X [ERROR] Could not resolve "@unocss/preset-uno"

    node_modules/unocss/dist/index.mjs:2:37:
      2 │ export { default as presetUno } from '@unocss/preset-uno';
        ╵                                      ~~~~~~~~~~~~~~~~~~~~

  You can mark the path "@unocss/preset-uno" as external to exclude it from the bundle, which will
  remove this error and leave the unresolved path in the bundle.
yyjiugui commented 1 month ago
import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";
import UnoCSS from "unocss/vite";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    uni(),
    // https://github.com/unocss/unocss
    UnoCSS(),
  ],
});
   "unocss": "^0.58.4",
   "unocss-preset-weapp": "^0.58.5",