gulpjs / glob-stream

Readable streamx interface over anymatch.
MIT License
178 stars 53 forks source link

gulp.dest() not working as expected #64

Closed jbeckton closed 8 years ago

jbeckton commented 8 years ago

Maybe I am confused but I thought the docs were pretty straight forward. My root project folder has a src folder and a dev folder. In the src folder I have my application files and when I compile the typescript I want the resulting js files generated into the dev folder which is where my web server is loading the built app from.

desired result myProject /src /src/index.html /src/app/main.ts gulpfile.js /dev /dev/index.html /dev/app/main.js /dev/app/main.js.map

I want /src/* to compile into /dev/* but what I am getting is /src folder is compiling into /dev so I have the following.. /dev/src/app/main.js

what I expect is /dev/app/main.js


gulp.task('compile-ts', function () {
    var tsResult = tsProject.src('src/**/*.ts', {base: 'src'}) 
        .pipe(ts(tsProject)); // transpile the files into .js

    return tsResult.js.pipe(gulp.dest('dev'));
});

tsconfig.json

{
  "compilerOptions": {
    "target": "es5",
    "module": "system",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false,
    "noExternalResolve": false 
  },
  "exclude": [
    "node_modules",
    "typings/main",
    "typings/main.d.ts"
  ]
}
phated commented 8 years ago

Don't put the base option and let us calculate the base based on the glob. Doc PRs are welcome.