Skip to content
New issue

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

"unocss/vite" resolved to an ESM file. #61

Closed
modushanghai opened this issue May 7, 2024 · 4 comments · Fixed by #64
Closed

"unocss/vite" resolved to an ESM file. #61

modushanghai opened this issue May 7, 2024 · 4 comments · Fixed by #64

Comments

@modushanghai
Copy link

node : 18.19.0
uniapp : 3.0.0-4010420240430001
unipp + vue3+ts 的cli

@Skiyee
Copy link
Member

Skiyee commented May 9, 2024

解决:

// vite.config.ts

export default async () => {
  const UnoCSS = (await import('unocss/vite')).default

  return defineConfig({
    plugins: [
      UnoCSS(),
    ],
  })
}

若想保持配置不变,请把 unocss 降至 v0.58.9及以下

@ModyQyW
Copy link
Member

ModyQyW commented May 10, 2024

我们是否应该更新一下 README?🤔

@Skiyee
Copy link
Member

Skiyee commented May 10, 2024

我昨天想更的,但不知道怎么写才最好

你如果得空的话,可以更新一下 ❤

@modushanghai
Copy link
Author

解决:

// vite.config.ts

export default async () => {
  const UnoCSS = (await import('unocss/vite')).default

  return defineConfig({
    plugins: [
      UnoCSS(),
    ],
  })
}

若想保持配置不变,请把 unocss 降至 v0.58.9及以下

我把vite.config.ts 文件名改为了 vite.config.mts 现在可以了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants