当我在我的主机应用程序上加载我的组件时,组件加载时没有css,我使用的是带有tailwind的Vite + Vue,有人知道如何加载这些样式吗?
这是我的邀请函:
import federation from "@originjs/vite-plugin-federation";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
export default defineConfig({
server: {
port: 8000,
},
build: {
target: ["chrome101", "edge89", "firefox89", "safari15"],
},
plugins: [
vue(),
federation({
name: "myLib",
filename: "remoteEntry.js",
// Modules to expose
exposes: {
"./Counter": "./src/components/Counter.vue",
"./Controller": "./src/controller.ts",
},
shared: ["vue", "css"],
}),
],
});
2条答案
按热度按时间xwmevbvl1#
尝试添加cssCodeSplit:false,例如:
kpbpu0082#