amd-optimize icon indicating copy to clipboard operation
amd-optimize copied to clipboard

define is not defined

Open DusanMilko opened this issue 9 years ago • 3 comments

Getting a define is not defined error.

Gulp:

return gulp.src('src/assets/js/*/') // Traces all modules and outputs them in the correct order. .pipe(amdOptimize("app", { paths : { "jquery" : "./bower_components/jquery/dist/jquery" } })) .pipe(concat("app.min.js")) .pipe(gulp.dest('build/assets/js/build'));


app.js

require([ 'globals' ],function(){});


globals.js

define(['jquery'], function($) { 'use strict';

console.log('hello');

});

DusanMilko avatar Oct 12 '15 21:10 DusanMilko

Hi there, I think you will need to add a RequireJS runtime to your build. Either the full RequireJS or Almond.

normanrz avatar Oct 13 '15 06:10 normanrz

Thanks for the quick reply.

I have my script tag as script data-main="/assets/js/build/app.min.js" src="/assets/js/build/require.js"

Get error: Uncaught ReferenceError: /assets/js/build/app.min.js: define is not defined

DusanMilko avatar Oct 13 '15 14:10 DusanMilko

Did you solve the problem? if so, how could you do that?

poc7667 avatar Mar 18 '16 14:03 poc7667