error in ./node_modules/@pixi/assets/lib/resolver/parsers/resolveTextureUrl.mjs
Module parse failed: Unexpected token (9:62)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| test: loadTextures.test,
| parse: (value) => ({
> resolution: parseFloat(settings.RETINA_PREFIX.exec(value)?.[1] ?? "1"),
| format: value.split(".").pop(),
| src: value
**@ ./node_modules/****@pixi/**assets/lib/index.mjs 20:0-77 20:0-77
pixi.js 是最新版本,7.2.4
低版本没发现有问题
问题原因:
因为导入的组件库是直接上源码的,必须告知webpack,需要编译一下这个库,让源码中的es6、es7的特性转换为es5
解决方案:
1.在vue.config.js 里面加上 transpileDependencies: ['/@pixi/']
module.exports = {
transpileDependencies: ['/@name/']
}
name 找报错的node_modules 里依赖的路径 **@ ./node_modules/****@pixi/**assets/lib/index.mjs 20:0-77 20:0-77