gulp编译的第三方es6的库,node环境下正常使用。creator里require时各种奇葩的 app.aser 报错,求解决方案
编译后是这种样子的,很像白鹭的编译
(function (f) {
if (typeof exports === “object” && typeof module !== “undefined”) {
module.exports = f()
} else if (typeof define === “function” && define.amd) {
define([], f)
} else {
var g;
if (typeof window !== “undefined”) {
g = window
} else if (typeof global !== “undefined”) {
g = global
} else if (typeof self !== “undefined”) {
g = self
} else {
g = this
}
g.b3 = f()
}
})(function () {
var define,
module,
exports;
return (function e(t, n, r) {
function s(o, u) {
if (!n[o]) {
if (!t[o]) {
var a = typeof require == “function” && require;
if (!u && a)
return a(o, !0);
if (i)
return i(o, !0);
var f = new Error(“Cannot find module '” + o + “’”);
throw f.code = “MODULE_NOT_FOUND”,
f
}
。。。。