welldone-software / gulp-durandal

Gulp plugin for building durandaljs projects
MIT License
13 stars 19 forks source link

Parse error reasons? #11

Closed JamesReate closed 10 years ago

JamesReate commented 10 years ago

Hi, I'm getting the following error when running the gulp task, but have no idea what it means:

[17:02:58] Durandal Error: Parse error using esprima for file: C:/path/to/my/Web/App/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js Error: Line 1: Unexpected token ILLEGAL at C:\path\to\my\Web\App\node_modules\gulp-durandal\node_modules\requirejs\bin\r.js:25416:47

My durandal App is pretty standard...

JamesReate commented 10 years ago

My gulp file looks like this:

var gulp = require('gulp'),
durandal = require("gulp-durandal");

gulp.task('durandal', function () {
    return durandal({
        baseDir: './',    //Same as default, so not really required.
        main: 'main.js',   //Same as default, so not really required.
        output: 'main.js', //Same as default, so not really required.
        //WARNING: Would overwrite existing file with same name.
        almond: true,
        minify: true
    })
        .pipe(gulp.dest('./app-gulped'));
});

gulp.task('default', ['durandal']);
JamesReate commented 10 years ago

Moral of that story: do not try to Gulp the current directory, always do it from one level above.