Questions tagged [almond]

A replacement AMD loader for RequireJS

A replacement AMD loader for RequireJS. It is a smaller "shim" loader, providing the minimal AMD API footprint that includes loader plugin support.

See https://github.com/jrburke/almond

46 questions
37
votes
5 answers

Why do concatenated RequireJS AMD modules need a loader?

We love RequireJS and AMD during development, where we can edit a module, hit reload in our browser, and immediately see the result. But when it comes time to concatenate our modules into a single file for production deployment, there apparently has…
Brandon Rhodes
  • 83,755
  • 16
  • 106
  • 147
34
votes
5 answers

Most Efficient Multipage RequireJS and Almond setup

I have multiple pages on a site using RequireJS, and most pages have unique functionality. All of them share a host of common modules (jQuery, Backbone, and more); all of them have their own unique modules, as well. I'm wondering what is the best…
davidtheclark
  • 4,666
  • 6
  • 32
  • 42
11
votes
2 answers

Using r.js to package a SPA application that loads views using 'text'

I'm attempting to build a SPA application (requirejs, durandal 2, knockout) into a single main-build.js file using grunt, and I'm running into serious issues with the 'text' plugin that durandal is using to load my views. In dev, I'm successfully…
Kieran Benton
  • 8,739
  • 12
  • 53
  • 77
11
votes
1 answer

Inline require() working in requirejs but not with optimized almond build

As the title says my inline require calls are working in a non-optimized requirejs run but not working when built with grunt and almondjs. Uncaught Error: undefined missing views/some/view The top of any file might be: define( ['jquery',…
David Duncan
  • 1,858
  • 17
  • 21
9
votes
2 answers

How do I export a global variable from Require.js?

I'm trying to make an external library using Require.js. Thanks to Require.js not compiling single js file correctly and Require.js (almond.js) Timing Off I've figured out how to get everything to "compile" in to a single optimized/built file, and…
machineghost
  • 33,529
  • 30
  • 159
  • 234
9
votes
1 answer

Avoid duplication of "paths" configuration in RequireJS main file and r.js build file?

Here is (part of) my folder structure: node-test bower_components build public main.js build.js Running the optimizer with r.js -o build.js and the following configuration works fine: // main.js file requirejs.config({ baseUrl:…
gremo
  • 47,186
  • 75
  • 257
  • 421
9
votes
2 answers

Getting RequireJS async plugin working with almond.js

I read the following article on how to get Google Maps, and gmaps.js to work with RequireJS. However, when I build my project, RequireJS is swapped with Almond. In the article above, it states that Almond will not work with the RequireJS async…
TYRONEMICHAEL
  • 4,174
  • 4
  • 30
  • 47
8
votes
1 answer

Using grunt requirejs with almond results in "define is not defined"

In my grunt.js file I've got requirejs: { dist: { options: { almond: true, wrap: true, modules: [{name: 'main'}], mainConfigFile: "src/js/main.js", baseUrl: "src/js", …
Peter
  • 946
  • 9
  • 23
6
votes
1 answer

Using almond with grunt-contrib-requirejs

I'm trying to set up a gruntfile that utilizes requirejs and almond. The docs suggest it should be really easy, and following their lead, I tried: requirejs: { compile: { options: { baseUrl: "tmp", mainConfigFile: "tmp/main.js", …
nullnullnull
  • 8,039
  • 12
  • 55
  • 107
4
votes
1 answer

Understanding r.js, almond, and relative paths

I see this answer but AFAICT it's not working for me. Maybe I'm doing something stupid. I'm using almond and grunt-contrib-requirejs. I've tried a bunch of stuff Here's my layout . ├── Gruntfile.js ├── 3rdparty │ ├── require.js ├── src │ ├──…
gman
  • 100,619
  • 31
  • 269
  • 393
4
votes
1 answer

Requirejs, almond, backbone, handlebars

Here's my situation, using Backbone and Handlebars with Requirejs. I'm following CommonJS module definition style, because I find myself to be more comfortable with it: define(function(require) { var Backbone = require('Backbone') var Item =…
S.C.
  • 2,844
  • 3
  • 26
  • 27
3
votes
1 answer

Any tools for developing modular serviceworker in typescript?

I would like to share source modules (classes) between the web app and the service worker but cannot find a way to do that using typescript alone. When using amd, as soon as I import a module the "self" is no longer on the initial thread. All that…
Corey Alix
  • 2,694
  • 2
  • 27
  • 38
3
votes
1 answer

r.js, almond: Is it possible for two .js files containing almond to share dependencies?

Is it possible to use almond with a multipage setup as follows: common.js is loaded on all pages & contains almond, bootstrap & jquery main1.js is loaded only on page 1 & contains almond, and app/main1.js which requires jquery. When i run the build…
Arctelix
  • 4,478
  • 3
  • 27
  • 38
2
votes
1 answer

SparkSession is not initialized with almond Jupyter

I'm trying to launch Almond Jupiter through docker or on line from https://almond.sh. In the spark.ipynb image, an error appears on the line with NotebookSparkSession import $ivy.`org.apache.spark::spark-sql:2.4.0` import…
Vadim
  • 753
  • 8
  • 22
2
votes
1 answer

How to use "Almond" in "RequireJS" to generate one single file?

I have a project with RequireJS. My app.build with require : ({ appDir: './', baseUrl: "js", dir: "dist", mainConfigFile: "js/main.js", modules: [ { name: 'main' } ], optimizeCss: 'standard', removeCombined: true, …
COSTADOR
  • 309
  • 2
  • 10
1
2 3 4