Skip to content

Commit 7bfae1e

Browse files
committed
Updated gulp example in README
1 parent bd3ce17 commit 7bfae1e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ module.exports = function(grunt) {
134134
var fs = require('fs'),
135135
amdclean = require('amdclean'),
136136
outputFile = data.path;
137+
137138
fs.writeFileSync(outputFile, amdclean.clean({
138139
'filePath': outputFile
139140
}));
@@ -152,23 +153,22 @@ module.exports = function(grunt) {
152153

153154
```javascript
154155
gulp.task('build', function() {
156+
var requirejs = require('requirejs');
157+
155158
requirejs.optimize({
156159
'findNestedDependencies': true,
157160
'baseUrl': './src/',
158161
'optimize': 'none',
159162
'include': ['first'],
160163
'out': './build/example.js',
161164
'onModuleBundleComplete': function(data) {
162-
var outputFile = data.path,
163-
cleanedCode = amdclean.clean({
164-
'filePath': outputFile
165-
});
166-
167-
if(error) {
168-
console.log('Looks like there was an error building, stopping the build... ' + cleanedCode);
169-
return;
170-
}
171-
fs.writeFileSync(outputFile, fullCode);
165+
var fs = require('fs'),
166+
amdclean = require('amdclean'),
167+
outputFile = data.path;
168+
169+
fs.writeFileSync(outputFile, amdclean.clean({
170+
'filePath': outputFile
171+
}));
172172
}
173173
});
174174
});

0 commit comments

Comments
 (0)