File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff 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
154155gulp .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});
You can’t perform that action at this time.
0 commit comments