使用unocss运行报错运行dev:weixin 报require() of ES Module xxx not supported.
Instead change the require of xxx to a dynamic import() which is available in all CommonJS modules.
vite.config.js是
import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import path from 'path'
import UnoCSS from 'unocss/vite'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [UnoCSS(), uni()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
}
}
})
vite-plugin-uni版本是 3.0.0-4000820240401001
unocss版本是0.59.4
0 个回复