admin管理员组

文章数量:1279050

My project has a folder named kaspa that was placed at the root directory. That folder are already been built by external parties so it must be left as is when running pnpm build.

I have set these options on my config file

nitro: {
  esbuild: {
    options: {
      target: 'esnext',
      exclude: [
        'kaspa/kaspa.js',
        'kaspa/kaspa.d.ts',
        'kaspa/kaspa_bg.wasm',
        'kaspa/kaspa_bg.wasm.d.ts',
      ],
    },
  },
},

vite: {
  optimizeDeps: {
    exclude: [
      'kaspa/kaspa.js',
      'kaspa/kaspa.d.ts',
      'kaspa/kaspa_bg.wasm',
      'kaspa/kaspa_bg.wasm.d.ts',
    ],
  },
},

as well as adding a .nuxtconfig file with the same content:

kaspa/kaspa.js
kaspa/kaspa.d.ts
kaspa/kaspa_bg.wasm
kaspa/kaspa_bg.wasm.d.ts

But it doesn't work.

Nuxt keeps rebuilding it, and compiled it as .nuxt/dist/server/_nuxt/kaspa-CvShH_pb.js. I don't want this because it replaces the classes to a minified object that causes this kind of error:

object constructor `et` does not match expected class `Resolver` 

class Resolver itself is part of kaspa. What can I do to make this work?

本文标签: nuxtjsI can39t make Nuxt ignore a folder at build timeStack Overflow