在学three.js过程中,引入RGBELoader之后出现Can't resolve 'zlib' 'fs''path''stream'错误
具体报错信息如下:
webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it
具体解决方法如下:
1、找到vue.config.js文件
2、将其修改成下方代码:
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,
lintOnSave: false,
configureWebpack: {
resolve: {
fallback: {
path: false,
stream: false,
zlib: false,
fs: false
},
},
}
})