前端vue项目安装three之后,npm run dev报错
error in ./node_modules/three/build/three.core.js
Module parse failed: Unexpected token (3030:8)
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
| class Vector2 {
|
> static {
|
| /**
如下图所示:

报错原因
Three.js 版本过高:从 r125+ 开始,Three.js 全面采用 ES6 类语法,而默认 Webpack 配置不处理 node_modules/three/ 中的现代 JS 语法。
解决报错
降低three的版本就不再报错了
npm install three@0.176