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
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -534,6 +534,10 @@ amdclean.clean({
534
534
// Determines if conditional AMD checks are transformed
535
535
// e.g. if(typeof define == 'function') {} -> if(true) {}
536
536
'transformAMDChecks':true,
537
+
// Determines if a named or anonymous AMD module will be created inside of your conditional AMD check
538
+
// Note: This is only applicable to JavaScript libraries, do not change this for web apps
539
+
// If set to true: e.g. define('example', [], function() {}) -> define([], function() {})
540
+
'createAnonymousAMDModule':false,
537
541
// Allows you to pass an expression that will override shimmed modules return
538
542
// values e.g. { 'backbone': 'window.Backbone' }
539
543
'shimOverrides': {},
@@ -700,6 +704,10 @@ __I am building a JavaScript library and want to provide conditional AMD support
700
704
701
705
2. Make sure that you have a comment (that matches your AMDclean `commentCleanName` option) one line above your conditional AMD if statement
702
706
707
+
__I am building a JavaScript library and want to create a conditional anonymous AMD module, but Require.js and AMDclean seems to always setting a module ID. How do I fix this?__
708
+
709
+
- It's easy, just make sure to set the `createAnonymousAMDModule` option to `true`,
710
+
703
711
704
712
__I don't like the way AMDclean normalizes the names of my modules with underscores. Can I change this?__
it('should create an anonymous AMD module, if the transformAMDChecks option is set to false and the createAnonymousAMDModule option is set to true',function(){
0 commit comments