You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-13Lines changed: 16 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,25 +26,20 @@ A build tool that converts AMD code to standard JavaScript.
26
26
27
27
## Why
28
28
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.
30
30
31
31
By incorporating amdclean.js into the build process, there is no need for Require or Almond.
32
32
33
33
Since AMDclean rewrites your source code into standard JavaScript, it is a great
34
34
fit for JavaScript library authors who want a tiny download in one file after using the
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
-
39
37
40
38
## Restrictions
41
39
42
40
**Note:** Same restrictions as almond.js.
43
41
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.
48
43
49
44
50
45
##What is Supported
@@ -70,7 +65,7 @@ Web - [Latest release](https://github.com/gfranko/amdclean/blob/master/src/amdcl
70
65
71
66
There are a few different ways that amdclean can be used including:
72
67
73
-
* With the RequireJS Optimizer (Grunt is also supported)
68
+
* With the RequireJS Optimizer (plain node, Grunt, Gulp, etc)
74
69
75
70
* As a standalone node module
76
71
@@ -175,10 +170,10 @@ var cleanedCode = cleanAMD.clean(code);
* Use the global `amdclean` object and `clean()` method
@@ -423,9 +418,9 @@ If your PR is a code change:
423
418
424
419
## FAQ
425
420
426
-
__Why would I use amdclean instead of Almond.js?__
421
+
__Why would I use AMDClean instead of Almond.js?__
427
422
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.
429
424
430
425
__AMDClean does not seem to be cleaning shimmed modules. What am I doing wrong?__
431
426
@@ -442,6 +437,14 @@ onModuleBundleComplete: function (data) {
442
437
}));
443
438
}
444
439
```
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`.
445
448
446
449
__What if I don't want all define() and require() method calls to be removed?__
0 commit comments