Skip to content

Commit 7529a7f

Browse files
committed
Merge branch 'master' of https://github.com/gfranko/amdclean
* 'master' of https://github.com/gfranko/amdclean: Updated Web Script Includes Fixed typo Updated FAQ Update README.md Update README.md
2 parents 827e08b + 44ce28f commit 7529a7f

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

README.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,20 @@ A build tool that converts AMD code to standard JavaScript.
2626

2727
## Why
2828

29-
Many developers like to use the AMD API to write modular JavaScript, but do not want to include a full AMD loader (e.g. [require.js](https://github.com/jrburke/requirejs)), or AMD shim (e.g. [almond.js](https://github.com/jrburke/almond)) because of file size/source code readability.
29+
Many developers like to use the AMD API to write modular JavaScript, but do not want to include a full AMD loader (e.g. [require.js](https://github.com/jrburke/requirejs)), or AMD shim (e.g. [almond.js](https://github.com/jrburke/almond)) because of file size/source code readability concerns.
3030

3131
By incorporating amdclean.js into the build process, there is no need for Require or Almond.
3232

3333
Since AMDclean rewrites your source code into standard JavaScript, it is a great
3434
fit for JavaScript library authors who want a tiny download in one file after using the
3535
[RequireJS Optimizer](http://requirejs.org/docs/optimization.html).
3636

37-
So, you get great code cleanliness with AMD, reduced file sizes, improved code readability, and easy integration with other developers who may not use AMD.
38-
3937

4038
## Restrictions
4139

4240
**Note:** Same restrictions as almond.js.
4341

44-
It is best used for libraries or apps that use AMD and:
45-
46-
* optimize all the modules into one file -- no dynamic code loading.
47-
* only have **one** require.config() call
42+
It is best used for libraries or apps that use AMD and optimize all the modules into one file -- no dynamic code loading.
4843

4944

5045
##What is Supported
@@ -70,7 +65,7 @@ Web - [Latest release](https://github.com/gfranko/amdclean/blob/master/src/amdcl
7065

7166
There are a few different ways that amdclean can be used including:
7267

73-
* With the RequireJS Optimizer (Grunt is also supported)
68+
* With the RequireJS Optimizer (plain node, Grunt, Gulp, etc)
7469

7570
* As a standalone node module
7671

@@ -175,10 +170,10 @@ var cleanedCode = cleanAMD.clean(code);
175170

176171
```html
177172
<script src="http://esprima.org/esprima.js"></script>
178-
<script src="http://esprima.org/test/3rdparty/escodegen.browser.js"></script>
179-
<script src="http://gregfranko.com/javascripts/estraverse.js"></script>
173+
<script src="http://constellation.github.io/escodegen/escodegen.browser.js"></script>
174+
<script src="https://rawgithub.com/Constellation/estraverse/master/estraverse.js"></script>
180175
<script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.2.1/lodash.js"></script>
181-
<script src="http://gregfranko.com/javascripts/amdclean.js"></script>
176+
<script src="https://rawgithub.com/gfranko/amdclean/master/src/amdclean.js"></script>
182177
```
183178

184179
* Use the global `amdclean` object and `clean()` method
@@ -423,9 +418,9 @@ If your PR is a code change:
423418

424419
## FAQ
425420

426-
__Why would I use amdclean instead of Almond.js?__
421+
__Why would I use AMDClean instead of Almond.js?__
427422

428-
- Although Almond is very small (~1k gzipped and minified), most JavaScript library authors do not want to have to include it in their library's source code. If you are not using an AMD plugin, then amdclean provides the benefit of AMD without increasing your library's file size.
423+
- Although Almond is very small (~1k gzipped and minified), most JavaScript library authors do not want to have to include it in their library's source code. AMDClean allows you to use AMD without increasing your library's file size.
429424

430425
__AMDClean does not seem to be cleaning shimmed modules. What am I doing wrong?__
431426

@@ -442,6 +437,14 @@ onModuleBundleComplete: function (data) {
442437
}));
443438
}
444439
```
440+
441+
__Is AMDClean only for libraries, or can I use it for my web app?__
442+
443+
- You can use it for both! The [0.6.0](https://github.com/gfranko/amdclean/releases/tag/0.6.0) release provided support for web apps.
444+
445+
__My comments seem to be getting removed when I use AMDClean. What am I doing wrong?__
446+
447+
- Before the `1.0.0` release, this was the default behavior. If you update to `1.0.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`.
445448

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

0 commit comments

Comments
 (0)