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...
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; }...
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...
As a simplified case, I have two async functions, foo and bar. bar needs the result of foo, i.e. bar depends on foo. I have no idea about which function will be called first.   If bar is invoked first, bar will call foo and start itself right after f...
I've got a complex architectural problem with bower. I'm building an online platform where user create pages using dynamic widgets which contain JS-code. Those widget have predefined format, description, icons etc., they will packaged into ar...
In my angular project, I recently upgraded rxjs to version 6. Now, a module from npm (inside the node_modules folder) is failing because of some breaking changes (old imports don't work anymore). I adapted the imports for my code, but how can I f...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.