Skip to content

Commit 09cc8d4

Browse files
committed
Updated README to point out the skipModuleInsertion issues and add a FAQ
1 parent f749dcd commit 09cc8d4

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

README.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,14 @@ module.exports = function(grunt) {
122122
requirejs: {
123123
js: {
124124
options: {
125-
findNestedDependencies: true,
126-
baseUrl: 'src/js/app/modules',
127-
wrap: true,
128-
preserveLicenseComments: false,
129-
optimize: 'none',
130-
mainConfigFile: 'src/js/app/config/config.js',
131-
include: ['first'],
132-
out: 'src/js/app/exampleLib.js',
133-
onModuleBundleComplete: function (data) {
125+
'findNestedDependencies': true,
126+
'baseUrl': 'src/js/app/modules',
127+
'optimize': 'none',
128+
'skipModuleInsertion': true,
129+
'mainConfigFile': 'src/js/app/config/config.js',
130+
'include': ['first'],
131+
'out': 'src/js/app/exampleLib.js',
132+
'onModuleBundleComplete': function (data) {
134133
var fs = require('fs'),
135134
amdclean = require('amdclean'),
136135
outputFile = data.path;
@@ -159,6 +158,7 @@ gulp.task('build', function() {
159158
'findNestedDependencies': true,
160159
'baseUrl': './src/',
161160
'optimize': 'none',
161+
'skipModuleInsertion': true,
162162
'include': ['first'],
163163
'out': './build/example.js',
164164
'onModuleBundleComplete': function(data) {
@@ -588,6 +588,17 @@ If your PR is a code change:
588588

589589
## FAQ
590590

591+
__After I build with AMDclean, I am getting JavaScript errors. What gives?__
592+
593+
- There could be a couple of reasons:
594+
595+
* Make sure to set the Require.js `skipModuleInsertion` option to `true`. By default, Require.js creates a `define()` wrapper for files that are not wrapped in a `define()`. This can cause issues with AMDclean.
596+
597+
* Make sure you are not pointing to minified files when building with AMDclean. This will definitely cause issues.
598+
599+
* There may be a bug with AMDclean (I doubt it, but it is possible). Please report any issues and they will be fixed as soon as possible.
600+
601+
591602
__Why should I use AMDclean instead of Browserify?__
592603

593604
- This is a loaded question. Here is a short list of pros/cons when using each library:

0 commit comments

Comments
 (0)