Comments (4)
Hmm, are you sure that TheoremJS doesn't support UMD / AMD? Here is the export.js
file that is copied at the end of the file:
// Browserify / Node.js
if (typeof define === "function" && define.amd) {
define(() => new TheoremJS());
// CommonJS and Node.js module support.
} else if (typeof exports !== "undefined") {
// Support Node.js specific `module.exports` (which can be a function)
if (typeof module !== "undefined" && module.exports) {
exports = module.exports = new TheoremJS();
}
// But always support CommonJS module 1.1.1 spec (`exports` cannot be a function)
exports.TheoremJS = new TheoremJS();
} else if (typeof global !== "undefined") {
global.TheoremJS = new TheoremJS();
}
I'm using gulp-rigger
instead of webpack, ... because it doesn't add extra piece of code, so the build is smaller. It's also much easier for me, because I don't need to write module.exports
at the end of each file.
from theoremjs.
@tmcw I'm closing this issue as I'm not sure why you opened it. If you want to reopen it, just add a comment telling so 😊.
from theoremjs.
Sure, the gist is that the module has define
, like an AMD package, but it also uses require
, like a CommonJS module. So there isn't a UMD/AMD implementation that will be able to use it. See, for example, the amdWeb example - dependencies are brought in as the first array argument to the define
function.
from theoremjs.
Ok, so tell me if I'm wrong but you're asking me to add .amdWeb
in export.js
?
from theoremjs.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from theoremjs.