使用Three.js作为封闭库? [英] Using Three.js as Closure library?

查看:107
本文介绍了使用Three.js作为封闭库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看看Three.js的构建脚本,我看到它们使用了Google Closure编译器.我有一个利用Three.js的小脚本.我可以使用Google Closure将Three.js作为库来编译脚本(而不是将Three.min.js前置或包含在HTML标记中),以便最终输出的javascript小得多.

Looking at Three.js's build script, I see they use Google Closure compiler. I am having a small script utilizing Three.js. Can I use Google Closure to compile the script with Three.js as a library (instead of having Three.min.js preambled or included in an HTML tag) so the final output javascript is much smaller.

我问这个问题是因为在Three.js源代码中看不到任何goog.provide.

I'm asking this because I don't see any goog.provide in Three.js source.

推荐答案

一种方法是使用您正在使用的任何shell或构建系统,将Three.js脚本添加到编译器输出中.

One way to do this is to prepend the three.js script to the compiler output using whatever shell or build system you are using.

这篇关于使用Three.js作为封闭库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆