Code Monkey home page Code Monkey logo

Comments (4)

arguiot avatar arguiot commented on June 11, 2024

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.

arguiot avatar arguiot commented on June 11, 2024

@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.

tmcw avatar tmcw commented on June 11, 2024

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.

arguiot avatar arguiot commented on June 11, 2024

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.