Skip to content

Commit e541749

Browse files
committed
Releasing AMDClean 1.2.1
1 parent 6adf26e commit e541749

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,14 @@ __I replaced Almond.js with AMDClean and my file is bigger. Why Is This?__
515515

516516
* Many of your individual module names are pretty long since they include the full path to a file. An example is `text_templates_headinghtml`. This module name could be changed to just `headinghtml` to save space. You can override the AMDClean module naming logic with the `prefixTransform` option to save some space.
517517

518+
__I am building a JavaScript library and want to provide conditional AMD support, but AMDClean seems to be wiping away my if statement. How do I fix this?__
519+
520+
- Make sure that you have a comment (that matches your AMDClean `commentCleanName` option) one line above your conditional AMD if statement
521+
522+
__I don't like the way AMDClean normalizes the names of my modules with underscores. Can I change this?__
523+
524+
- You sure can. You can either use the `prefixMode` and change it to camelCase, or you can override all of the logic with your own logic by using the `prefixTransform` option hook.
525+
518526

519527
## License
520528

build/amdclean.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

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

src/amdclean.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! amdclean - v1.2.0 - 2014-02-17
1+
/*! amdclean - v1.2.1 - 2014-02-17
22
* http://gregfranko.com/amdclean
33
* Copyright (c) 2014 Greg Franko; Licensed MIT*/
44

@@ -35,27 +35,27 @@
3535
that = scope,
3636
// Third-Party Dependencies
3737
esprima = (function() {
38-
if(cleanamd.amd && amdDependencies.esprima) {
38+
if(cleanamd.amd && amdDependencies.esprima && amdDependencies.esprima.parse) {
3939
return amdDependencies.esprima;
40-
} else if(that && that.esprima) {
40+
} else if(that && that.esprima && that.esprima.parse) {
4141
return that.esprima;
4242
} else if(codeEnv === 'node') {
4343
return require('esprima');
4444
}
4545
}()),
4646
estraverse = (function() {
47-
if(cleanamd.amd && amdDependencies.estraverse) {
47+
if(cleanamd.amd && amdDependencies.estraverse && amdDependencies.estraverse.traverse) {
4848
return amdDependencies.estraverse;
49-
} else if(that && that.estraverse) {
49+
} else if(that && that.estraverse && that.estraverse.traverse) {
5050
return that.estraverse;
5151
} else if(codeEnv === 'node') {
5252
return require('estraverse');
5353
}
5454
}()),
5555
escodegen = (function() {
56-
if(cleanamd.amd && amdDependencies.escodegen) {
56+
if(cleanamd.amd && amdDependencies.escodegen && amdDependencies.escodegen.generate) {
5757
return amdDependencies.escodegen;
58-
} else if(that && that.escodegen) {
58+
} else if(that && that.escodegen && that.escodegen.generate) {
5959
return that.escodegen;
6060
} else if(codeEnv === 'node') {
6161
return require('escodegen');
@@ -74,7 +74,7 @@
7474
// The Public API object
7575
publicAPI = {
7676
// Current project version number
77-
'VERSION': '1.2.0',
77+
'VERSION': '1.2.1',
7878
// Default Options
7979
'defaultOptions': {
8080
// The source code you would like to be 'cleaned'

0 commit comments

Comments
 (0)