Skip to content

Commit

Permalink
Releasing AMDClean v0.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
gfranko committed Nov 25, 2013
1 parent 4df513e commit 4b89e3c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ It is best used for libraries or apps that use AMD and:

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

* [Simplified CJS wrapper](https://github.com/jrburke/requirejs/wiki/Differences-between-the-simplified-CommonJS-wrapper-and-standard-AMD-define#wiki-cjs)

* Exporting global modules to the `window` object

* Storing all local modules inside of a global object (Helps scoping issues for certain use cases)

## Download

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

- 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.

__How would I expose one or more modules as a global window property?__

- You can use the `globalModules` option to list all of the modules that you would like to expose as a `window` property

__I am having a scope problem with all of the local module variables. What can I do?__

- You can use the `globalObject` option to store all of your modules in a global object that uses the top-most function scope.


## License

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "amdclean",
"version": "0.2.6",
"version": "0.2.7",
"description": "A build tool that converts AMD code to standard JavaScript",
"main": "./src/amdclean",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions src/amdclean.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! amdclean - v0.2.6 - 2013-10-15
/*! amdclean - v0.2.7 - 2013-11-25
* http://gregfranko.com/amdclean
* Copyright (c) 2013 Greg Franko; Licensed MIT*/

Expand Down Expand Up @@ -35,7 +35,7 @@
// The Public API object
publicAPI = {
// Current project version number
VERSION: '0.2.6',
VERSION: '0.2.7',
// Default Options
defaultOptions: {
'globalObject': false,
Expand Down

0 comments on commit 4b89e3c

Please sign in to comment.