Javascript 在google web app脚本中使用three.js-无法使用脚本模块类型加载three.js

Javascript 在google web app脚本中使用three.js-无法使用脚本模块类型加载three.js,javascript,google-apps-script,three.js,Javascript,Google Apps Script,Three.js,我想在google web脚本中使用three.js加载3D CAD文件,而在threejs.org上的安装说明中,它解释了脚本需要是“模块”类型。同时,在我搜索了几天之后,google web应用程序脚本似乎不支持“模块” 有没有人用过google脚本的three.js?非常感谢分享您的经验。否则,我不得不放弃将CAD数据加载到我正在构建的web应用程序上的想法 <script type="module"> // Find the latest versi

我想在google web脚本中使用three.js加载3D CAD文件,而在threejs.org上的安装说明中,它解释了脚本需要是“模块”类型。同时,在我搜索了几天之后,google web应用程序脚本似乎不支持“模块”

有没有人用过google脚本的three.js?非常感谢分享您的经验。否则,我不得不放弃将CAD数据加载到我正在构建的web应用程序上的想法

<script type="module">

  // Find the latest version by visiting https://unpkg.com/three. The URL will
  // redirect to the newest stable release.
  import * as THREE from 'https://unpkg.com/three/build/three.module.js';

  const scene = new THREE.Scene();

</script>

//通过访问查找最新版本https://unpkg.com/three. URL将
//重定向到最新的稳定版本。
将*作为三个源导入'https://unpkg.com/three/build/three.module.js';
const scene=new THREE.scene();
应用程序脚本不支持模块 发件人:

注意:ES6模块尚不受支持

但是,您可以像调用jQuery这样的库一样调用脚本


Web应用程序示例 代码.gs

函数doGet(){
HTMLOutput=HtmlService.createHtmlOutputFromFile('index.html'))
返回HTMLOutput
}
index.html


我的前三个.js应用程序
正文{页边距:0;}
const scene=new THREE.scene();
const-camera=新的三视角摄像机(75,window.innerWidth/window.innerHeight,0.11000);
const renderer=new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth、window.innerHeight);
document.body.appendChild(renderer.doElement);
const geometry=new THREE.BoxGeometry();
const material=new THREE.MeshBasicMaterial({color:0x00ff00});
常量立方体=新的三个网格(几何体、材质);
场景.添加(立方体);
摄像机位置z=5;
常量animate=函数(){
请求动画帧(动画);
立方体旋转.x+=0.01;
立方体旋转y+=0.01;
渲染器。渲染(场景、摄影机);
};
制作动画();
改编自:

结果 将其部署为Web应用程序时,我得到以下结果:

工具书类

您可以上传自己的Three.js副本,然后在本地导入吗?类似于“libs/THREE.module.js”中的
import*as THREE?还有一个问题,当我添加下面这样的脚本时,如果答案有效,您应该接受它,或者查看本文以获得更多选项。另外,你的问题看起来像是被删掉了,你说“当我在[链接]下面添加脚本时”,然后什么都没有,问题是什么?