sonofmagic / tailwindcss-mangle

a obfuscator tool for tailwindcss mangle
73 stars 0 forks source link

nuxt3 build报错:The symbol "createError" has already been declared #30

Open zwying0814 opened 12 months ago

zwying0814 commented 12 months ago

感谢作者开发这款工具,我在nuxt3平台下使用时,遇到如下错误:

The symbol "createError" has already been declared

image

这是nuxt.config.ts文件内容:

// https://nuxt.com/docs/api/configuration/nuxt-config
import { vitePlugin as utwm } from 'unplugin-tailwindcss-mangle'
export default defineNuxtConfig({
  runtimeConfig: {
    public: {
      baseURL: process.env.BASE_URL || "http://127.0.0.1:19800/api",
    },
  },
  devtools: { enabled: true },
  pages: true,
  modules: [
    "@nuxtjs/tailwindcss",
    "nuxt-headlessui",
    "@nuxtjs/color-mode",
    "floating-vue/nuxt",
    "@pinia/nuxt",
    "@pinia-plugin-persistedstate/nuxt",
  ],
  app: {
    head: {
      link: [{ rel: "stylesheet", href: "/HarmonyOS/font.css" }],
    },
  },
  vite: {
    plugins: [utwm()],
  },
});

这有可能是什么原因导致的?

sonofmagic commented 12 months ago

目前 spa 运转还算良好,ssr 框架,想那些 nextjs 还要你用的 nuxtjs3 啥的,因为他们是打多个包的(server/client) 等等,目前混淆 server 端包的时候有各种奇怪的问题,比如你遇到的这个。

头疼,没找到好的解决方案。

sonofmagic commented 10 months ago

Hi, unplugin-tailwindcss-mangle@2.0.6 is release, This version has fixed this issue. Have a try! :)