防止 spine-core 会存在两份类实例
This commit is contained in:
1 parent
a80575ef5e
commit
a516777eb6
1 file changed
+4
-1
+4
-1
@@ -42,7 +42,10 @@ export default defineConfig({
|
|||||||
host: true,
|
host: true,
|
||||||
},
|
},
|
||||||
// 让 node_modules 里的 ESM 依赖能直接 work
|
// 让 node_modules 里的 ESM 依赖能直接 work
|
||||||
|
// 必须同时预打包 spine-core 与 spine-pixi-v7:否则 spine-core 会存在两份类实例,
|
||||||
|
// 使 spine-pixi-v7 里 `attachment instanceof RegionAttachment` 对项目解析的 attachment 判 false,
|
||||||
|
// 导致 renderMeshes 不生成任何网格、Spine 渲染空白。
|
||||||
optimizeDeps: {
|
optimizeDeps: {
|
||||||
include: ['@esotericsoftware/spine-pixi-v7'],
|
include: ['@esotericsoftware/spine-core', '@esotericsoftware/spine-pixi-v7'],
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
Reference in new issue
Block a user