I have a web project that's built with Maven and I'm trying to figure out the best way to compile the JavaScript files with the RequireJS compiler (this question could apply to any compiler/minifier as well).  I have a setup that works, but i...
I'm just cloned a repo, which recommends the use of Yarn to install dependencies. When I run yarn install, it seems to be okay, but it provides this warning:  yarn install v0.20.3 [1/4] ????  Resolving packages... [2/4] ????  Fetching packages......
The problem is this, I include a script, it uses another one, but what if that dependency also needs another script to be ready ? Which means loading it is not enough, but I also need to be sure its callback for initialization has been called before...
I have a JS library that does something like so:  let OptionalLib; function foo() {   OptionalLib = require('optionallib');   // Do stuff...   return (something from optional lib); }   then I add typings in a .d.ts file:  declare module '...
I'm building an application with KnockoutJS with a component that essentially acts as a sequential spreadsheet.  On different lines users may define variables or use them to represent a value.  So for example  x =2  x  //2 x = 4 x  //4   I have t...
I have a problem with requirejs and a dependency being undefined.  My setup is the following:  var lib = function (){...};  define(function() {     return lib; });   And the modules are define like this  var mod = function (){    ...    lib('para...
Is there any way in Jest to mock global objects, such as navigator, or Image*? I've pretty much given up on this, and left it up to a series of mockable utility methods. For example:  // Utils.js export isOnline() {     return navigator.onLine; }...
Should the RequireJS script tag be located in the <head> or bottom of an HTML page?  <script data-main="resources/js/main" src="require.js"></script>   I have seen reputable sources place the RequireJS script tag in...
I have a form that is suposed to help to user to choose a specific thing at the end, but as the user fills the first options, the others below change. Something like this:  Type: {     t1:{         Number of X:{             1:{...}             2:{......
I am trying to wrap my head around dependencies in requirejs.   If I already declared dependencies for a file using shim, do I need to re-declare it when I define the module in that file? If I use require to load dependencies such as backbone, do I n...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.