我想在'webpack'中使用'THREE.js',就像这样。
THREE = require './three'
//code + THREE.js -> webpack.js
<script src = "webpack.js"></script>
此代码不起作用。
<script src = 'three.js'></script>
<script src = 'webpack.js'></script> //not include THREE.js
这段代码很顺利。请告诉我使用'require'来使用'THREE.js'的方法。
答案 0 :(得分:2)
在npm上有一个&#34;要求&#34; -able版本的Three.js:https://www.npmjs.org/package/three
这也应与webpack兼容。