Closed varlinor closed 8 years ago
after several try, I found change 'baseUrl' to '.' , at same time , change configuration of gulp.src 'base' to 'static' , the plugin works rightly. the final script is following:
gulp.task('build', function () { gulp.src([ 'static/app/extend/widgetsDefine.js', 'static/modules/myModule/!.js', '!static/modules/myModule/!.min.js'],{base:'static'}) .pipe(amdOptimize("static/modules/myModule/moduleEntry", { baseUrl:'.', configFile:'main.js', exclude:[ 'static/modules/otherModules/moduleC', 'static/app/extend/widgetsDefine.js' ], findNestedDependencies:false })) .pipe(concat("moduleEntry-concat.js")) .pipe(gulp.dest("static/modules/myModule")) .pipe(rename("moduleEntry-concat.min.js")) .pipe(uglify()) .pipe(gulp.dest("static/modules/myModule")); });
I have an js file in another directory, but my project need to import this file, structure is following: -webapp require.config.js static/modules/myModule/ moduleEntry.js dependencyA.js dependencyB.js ...... static/app/extend/widgetsDefine.js
and gulp script is like this:
then amd-optimize catch an error: Error: No file for module 'static/modules/myModule/moduleEntry' found.
so , How can I import a js file form a different directory?
waiting for answer sincerely
combine with issue comment at 23#issuecomment-237820420