Skip to content

Commit 9fc6c98

Browse files
committed
Updated README
1 parent 470f8d5 commit 9fc6c98

File tree

1 file changed

+20
-24
lines changed

1 file changed

+20
-24
lines changed

README.md

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ A build tool that converts AMD and/or CommonJS code to standard JavaScript.
1212

1313
## Use Case
1414

15-
**Single file** client-side JavaScript libraries or web apps that want to use AMD or CommonJS modules to structure and build their code, but don't want any additional footprint.
15+
**Single file** client-side JavaScript libraries or web apps that want to use AMD and/or CommonJS modules to structure and build their code, but don't want any additional footprint.
1616

1717

1818
## Used By
1919

20-
* [AMDclean](https://github.com/gfranko/amdclean) - A build tool that converts AMD code to standard JavaScript
20+
* [AMDclean](https://github.com/gfranko/amdclean) - A build tool that converts AMD code to standard JavaScript (this is not a typo)
2121

2222
* [Backbone-Require-Boilerplate](https://github.com/BoilerplateMVC/Backbone-Require-Boilerplate) - A Rad Backbone.js and Require.js Boilerplate Project
2323

@@ -34,7 +34,7 @@ A build tool that converts AMD and/or CommonJS code to standard JavaScript.
3434

3535
Many developers like to use the AMD and/or CommonJS (CJS) module APIs to write modular JavaScript, but do not want to include a full AMD or CJS loader (e.g. [require.js](https://github.com/jrburke/requirejs)), or shim (e.g. [almond.js](https://github.com/jrburke/almond), [browserify](http://browserify.org/)) because of file size/source code readability concerns.
3636

37-
By incorporating AMDclean.js into the build process, you no longer need to include Require.js or use Browserify.
37+
By incorporating AMDclean.js into the build process, you no longer need to include Require.js or Almond.js in production, or use Browserify.
3838

3939
Since AMDclean rewrites your source code into standard JavaScript, it is a great
4040
fit for JavaScript library/web app authors who want a tiny download in one file after using the
@@ -66,15 +66,15 @@ It is best used for libraries or apps that use AMD or CommonJS (using the [cjsTr
6666

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

69-
- full-fledged CommonJS files using the [cjsTranslate](https://github.com/jrburke/r.js/blob/master/build/example.build.js#L574) Require.js option.
69+
- full-fledged CommonJS files using the [cjsTranslate](https://github.com/jrburke/r.js/blob/master/build/example.build.js#L584) Require.js option.
7070

7171
* Exporting global modules to the global `window` object
7272

7373
## Download
7474

7575
Node - `npm install amdclean --save-dev`
7676

77-
Web - [Latest release](https://github.com/gfranko/amdclean/blob/master/src/amdclean.js)
77+
Web - [Latest release](https://github.com/gfranko/amdclean/blob/master/build/amdclean.js)
7878

7979

8080
## Usage
@@ -87,7 +87,7 @@ There are a few different ways that AMDclean can be used including:
8787

8888
* As a client-side library
8989

90-
**Note:** AMDclean does not have any module ordering logic, so if you do not use the RequireJS optimizer you need to find another solution for resolving module dependencies before your files can be "cleaned".
90+
**Note:** AMDclean does not have any module ordering logic, so if you do not use the RequireJS optimizer then you need to find another solution for resolving module dependencies before your files can be "cleaned".
9191

9292

9393
###AMDclean with the RequireJS Optimizer
@@ -96,7 +96,7 @@ There are a few different ways that AMDclean can be used including:
9696

9797
* `npm install amdclean --save-dev`
9898

99-
* Add an `onModuleBundleComplete` config property to your RequireJS build configuration file instead. Like this:
99+
* Add a `onModuleBundleComplete` config property to your RequireJS build configuration file instead. Like this:
100100

101101
```javascript
102102
onModuleBundleComplete: function (data) {
@@ -113,7 +113,7 @@ onModuleBundleComplete: function (data) {
113113

114114
* Run the optimizer using [Node](http://nodejs.org) (also [works in Java](https://github.com/jrburke/r.js/blob/master/README.md)). More details can be found in the the [r.js](https://github.com/jrburke/r.js/) repo.
115115

116-
* If you are using the RequireJS optimizer [Grunt task](https://github.com/gruntjs/grunt-contrib-requirejs), then it is very easy to integrate amdclean using the `onModuleBundleComplete` config option. Here is an example Grunt file that includes the RequireJS optimizer plugin with AMDclean support:
116+
* If you are using the RequireJS optimizer [Grunt task](https://github.com/gruntjs/grunt-contrib-requirejs), then it is very easy to integrate AMDclean using the `onModuleBundleComplete` config option. Here is an example Grunt file that includes the RequireJS optimizer plugin with AMDclean support:
117117

118118
```javascript
119119
module.exports = function(grunt) {
@@ -148,7 +148,7 @@ module.exports = function(grunt) {
148148
};
149149
```
150150

151-
* If you are using the RequireJS node module with [Gulp](http://gulpjs.com/), then it is very easy to integrate amdclean using the `onModuleBundleComplete` config option. Here is an example Gulp task that includes the RequireJS optimizer node module with AMDclean support:
151+
* If you are using the RequireJS node module with [Gulp](http://gulpjs.com/), then it is very easy to integrate AMDclean using the `onModuleBundleComplete` config option. Here is an example Gulp task that includes the RequireJS optimizer node module with AMDclean support:
152152

153153
```javascript
154154
gulp.task('build', function() {
@@ -170,13 +170,8 @@ gulp.task('build', function() {
170170
}
171171
fs.writeFileSync(outputFile, fullCode);
172172
}
173-
}, function() {
174-
console.log('Your Require.js optimizer build was successful');
175-
}, function(err) {
176-
console.log('Looks like there was an error building, stopping the build... ', err);
177173
});
178174
});
179-
};
180175
```
181176

182177
###AMDclean as a Node Module
@@ -377,7 +372,7 @@ third = {
377372

378373
###Require Calls
379374

380-
**Note:** `require(['someModule'])` calls are removed from the built source code
375+
**Note:** `require(['someModule'])` calls, with no callback function, are removed from the built source code
381376

382377
_AMD_
383378

@@ -418,7 +413,7 @@ _Standard_
418413

419414
AMDclean uses a few different strategies to decrease file size:
420415

421-
**Remove Unused Dependencies**
416+
**Remove Unused Dependencies/Parameters**
422417

423418
_AMD_
424419

@@ -432,14 +427,14 @@ _Standard_
432427

433428
```javascript
434429
// Since no callback parameters were provided in the AMD code,
435-
// the 'example1' and 'example2' parameters were removed
430+
// the 'example1' and 'example2' dependencies/parameters were not added
436431
var example;
437432
example = function() {
438433
var test = true;
439434
}();
440435
```
441436

442-
**Remove Exact Matching Dependencies**
437+
**Remove Exact Matching Dependencies/Parameters**
443438

444439
_AMD_
445440

@@ -452,8 +447,8 @@ define('example', ['example1', 'example2'], function(example1, anotherExample) {
452447
_Standard_
453448

454449
```javascript
455-
// Since the `example1` callback function parameter exactly matched,
456-
// the name of the `example1 dependency, it's parameters were removed
450+
// Since the `example1` callback function parameter exactly matched
451+
// the name of the `example1 dependency, it's `example1` dependency/parameter was removed
457452
var example;
458453
example = function(anotherExample) {
459454
var test = true;
@@ -568,7 +563,7 @@ amdclean.clean({
568563

569564
## Unit Tests
570565

571-
All unit tests are written using the [jasmine-node](https://github.com/mhevery/jasmine-node) library and can be found in the `test/specs/` folder. You can run the unit tests by typing: `npm test`.
566+
All unit tests are written using the [jasmine-node](https://github.com/mhevery/jasmine-node) library and can be found in the `test/specs/` folder. You can run the unit tests by typing: `npm test` or `gulp test`.
572567

573568
## Contributing
574569

@@ -601,12 +596,13 @@ __Why should I use AMDclean instead of Browserify?__
601596

602597
* Requires a development build step
603598
* Does not support AMD modules out of the box
599+
* Does not support dynamic module loading out of the box
604600
* Adds boilerplate code to files (increasing file size and decreasing code readability)
605601

606602
**AMDclean Pros**
607603

608604
* Does not require a build step in development when used with Require.js
609-
* Supports both AMD and CommonJS modules when used the Require.js optimizer
605+
* Supports both AMD and CommonJS modules when used with the Require.js optimizer
610606
* Does not add boilerplate code to files and uses advanced file optimizations to decrease file size and increase code readability
611607

612608
**AMDclean Cons**
@@ -652,12 +648,12 @@ __Is AMDclean only for libraries, or can I use it for my web app?__
652648

653649
__My comments seem to be getting removed when I use AMDclean. What am I doing wrong?__
654650

655-
- Before the `1.4.0` release, this was the default behavior. If you update to `1.4.0` or later, you should see your comments still there after the cleaning process. Also, if you would like your comments to be removed, then you can set the `comment` **escodegen** option to `false`.
651+
- Before the `2.1.0` release, this was the default behavior. If you update to `2.1.0` or later, you should see your comments still there after the cleaning process. Also, if you would like your comments to be removed, then you can set the `comment` **escodegen** option to `false`.
656652

657653

658654
__What if I don't want all define() and require() method calls to be removed?__
659655

660-
- If you don't want one or more define() and require() methods to be removed by `amdclean`, you have a few options. If the module has a named module id associated with it, then you can add the associated module id to the `ignoreModules` option array. Like this:
656+
- If you don't want one or more define() and require() methods to be removed by AMDclean, you have a few options. If the module has a named module id associated with it, then you can add the associated module id to the `ignoreModules` option array. Like this:
661657

662658
```javascript
663659
var amdclean = require('amdclean');

0 commit comments

Comments
 (0)