Skip to content

Commit 4b89e3c

Browse files
committed
Releasing AMDClean v0.2.7
1 parent 4df513e commit 4b89e3c

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

README.md

+21
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ It is best used for libraries or apps that use AMD and:
4040

4141
* `define()` and `require()` calls.
4242

43+
* [Simplified CJS wrapper](https://github.com/jrburke/requirejs/wiki/Differences-between-the-simplified-CommonJS-wrapper-and-standard-AMD-define#wiki-cjs)
44+
45+
* Exporting global modules to the `window` object
46+
47+
* Storing all local modules inside of a global object (Helps scoping issues for certain use cases)
48+
4349
## Download
4450

4551
Node - `npm install amdclean`
@@ -278,6 +284,13 @@ The amdclean `clean()` method accepts a string or an object. Below is an exampl
278284
amdclean.clean({
279285
// The source code you would like to be 'cleaned'
280286
code: 'define("example", [], function(one, two) {});',
287+
// The modules that you would like to set as window properties
288+
// An array of strings (module names)
289+
globalModules: [],
290+
// Determines if all of your local modules are stored in a single global object (helps with scoping in certain cases)
291+
globalObject: false,
292+
// Determines the name of your global object that stores all of your global modules
293+
globalObjectName: 'amdclean',
281294
// All esprima API options are supported: http://esprima.org/doc/
282295
esprima: {},
283296
// All escodegen API options are supported: https://github.com/Constellation/escodegen/wiki/API
@@ -310,6 +323,14 @@ __Why are define() method placeholder functions inserted into my source?__
310323

311324
- This is the default behavior of r.js when a module(s) is not wrapped in a define() method. Luckily, this behavior can be overridden by setting the `skipModuleInsertion` option to `true` in your build configuration.
312325

326+
__How would I expose one or more modules as a global window property?__
327+
328+
- You can use the `globalModules` option to list all of the modules that you would like to expose as a `window` property
329+
330+
__I am having a scope problem with all of the local module variables. What can I do?__
331+
332+
- You can use the `globalObject` option to store all of your modules in a global object that uses the top-most function scope.
333+
313334

314335
## License
315336

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "amdclean",
3-
"version": "0.2.6",
3+
"version": "0.2.7",
44
"description": "A build tool that converts AMD code to standard JavaScript",
55
"main": "./src/amdclean",
66
"repository": {

src/amdclean.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! amdclean - v0.2.6 - 2013-10-15
1+
/*! amdclean - v0.2.7 - 2013-11-25
22
* http://gregfranko.com/amdclean
33
* Copyright (c) 2013 Greg Franko; Licensed MIT*/
44

@@ -35,7 +35,7 @@
3535
// The Public API object
3636
publicAPI = {
3737
// Current project version number
38-
VERSION: '0.2.6',
38+
VERSION: '0.2.7',
3939
// Default Options
4040
defaultOptions: {
4141
'globalObject': false,

0 commit comments

Comments
 (0)