I'm not able to get TweeLite to work with browserify. I'm an extreme noob when it comes to CommonJS.  I've installed gasp v1.13.2 using Bower and include it like this:  var TweenLite = require("../../bower_components/gsap/src/minified...
I write a module in nodejs ,which Test.js ,code blow  function Test() {     this.key = 'value'; } Test.prototype.foo = function () { return 'foo'; } module.exports = Test;   and then, in B.js  var Test = require('./services/Test&#...
I'm trying to pull an entire module into the current scope of another file after a require call.  For instance if my module looks like this:  exports.chai = require "chai" exports.mocha = require "mocha" exports.Q = require "q...
After reading all the relevant answers in SO and posts in the Appcelerator forums I still can't get this to work:  I have an application developed in Appcelerator, and I want to load an external JavaScript file in some of my controllers.  My App...
The title seems confusing but I'll give an example.  Let's say I create a module that uses ES6 that runs in the browser, so I use browserify with babelify to build everything.  Now I want to include that same module in a project that uses bro...
My CommonJS module uses a factory style object creation (.create()) and I try to have JSDoc style documentation but cannot figure out which JSDoc tags @class, @module etc. I should to use to do it nicely. Below you can see a simplified structure of t...
So, I am using RequireJS and React, trying to load a third-party component, which has been installed with:  npm install react-autocomplete   The structure is here: https://github.com/rackt/react-autocomplete/tree/master/lib  Now, I have a main.js fil...
Suppose I have an UMD module like this (saved in 'js/mymodule.js'):  (function (global, factory) {   typeof exports === 'object' && typeof module !== 'undefined' ?     factory(exports) :   typeof define === 'functi...
If we have different bundles created by webpack and we require.ensure something to dynamically transfer+eval it at a later point in time, it happens via jsonPadding and some webpack js magic. If we have  require.ensure([ ], ( require ) => {     co...
I just took a shot at wrapping one of our modules that is meant to be included via a <script> tag in some boilerplate to allow optional AMD loading with requirejs.  It was quite painful and the best I could come up with is:  (function(){ var ex...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.