That does nothing.
// Terse implementations of the returnExports UMD wrapper (https://github.com/umdjs/umd/blob/master/returnExports.js) | |
// No dependencies | |
(function (root, factory) { | |
if (typeof exports === 'object') module.exports = factory(); | |
else if (typeof define === 'function' && define.amd) define(factory); | |
else root.moduleName = factory(); | |
}(this, function () { | |
// Return a module definition | |
return {}; |
Earlier today, I tweeted 'requirejs, why so complicated?' [1]
To add some context, I'm working on a project that involves relatively complex pipelining of static assets, and I'm investigating use of the RequireJS optimizer programmatically [2] to handle the part of the process that bundles related JS modules into bundled scripts to be passed down the pipeline for minification, fingerprinting, and deployment.
In retrospect, the answer to my flippant tweet is "because the tool solves a lot of complicated problems", but it took a while to back out from a long description of the various configuration options [3] to the options that were relevant to my problem. In particular, I felt it would have been helpful to have required options called out first, as I spent a while with a baseUrl
assuming that all the js files in that dir would be optimized into the output. Instead, I got a cryptic Cannot read property '0' of undefined
error.
I eventually realized that I needed to provide at least one module to optim
/** | |
* asynchronicity.js | |
* | |
* Steve Lloyd <[email protected]> | |
* | |
* Exploratory script covering various issues that arise working with | |
* asychronous javascript functions. This script is intended to be run from | |
* the command line with node, i.e.: | |
* $ node asynchronicity.js | |
* |
/** | |
* Example structure for nodeunit tests with nested groups and setup/teardown | |
* functions. Run | nodeunit nodeunit_example.js | to see a printout of | |
* function names in the order that they are called. There aren't any actual | |
* tests here. | |
*/ | |
process.env.NODE_ENV = 'test'; | |
var testCase = require('nodeunit').testCase; |
var playdar = Cc['@repeatingbeats.com/playdar/playdar-service;1'] | |
.getService(Ci.sbIPlaydarService); |