vueComponent / ant-design-vue-nuxt

MIT License
61 stars 6 forks source link

Lost style after packaging (打包后样式丢失) #14

Closed YernarT closed 10 months ago

YernarT commented 10 months ago

使用 pnpm generate 打包 Nuxt3 项目后所有 ant-design-vue 的组件样式都丢失了, JS 还存在。

依赖:

"dependencies": {
    "ant-design-vue": "^4.0.0",
  },
  "devDependencies": {
    "@ant-design-vue/nuxt": "^1.0.1",
    "nuxt": "^3.6.2",
  }

执行的打包命令: "generate": "nuxt generate",

Nuxt配置:

export default defineNuxtConfig({
  srcDir: "src/",

  modules: ["@ant-design-vue/nuxt"],
});

在项目中的使用方式: 没有手动导入,使用自动导入的

<template>
  <a-button type="primary">Hello Wolrd</a-button>
</template>

<script setup />

打包后该组件的class都还在(antd 本身添加的类名),但是没有对应的css样式。

aibayanyu20 commented 10 months ago

等主库发版后会解决这个水合的问题

aibayanyu20 commented 10 months ago

已经发版了,参考demo