Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gulpjs recommends upgrading of vinyl for dependent plugins due to issues with gulp 4.0.0-alpha.3 #551

Closed
dozer75 opened this issue Dec 22, 2017 · 1 comment
Labels

Comments

@dozer75
Copy link

dozer75 commented Dec 22, 2017

Expected behavior:
when using the latest version of gulp 4.0.0 alpha 3 typescript compilation should work.

Actual behavior:

In it's latest alpha gulp have upgraded the usage of vinyl to 2.0 or 2.1 (or in your case it seems that upgrading to vinyl-fs to ^3.0.0), somehow (I don't know why) this breaks building typescripts with gulp-typescript. See gulpjs/gulp#2065 for more information.

Your gulpfile:

Include your gulpfile, or only the related task (with ts.createProject).

var gulp = require("gulp");
var typescript = require("gulp-typescript");
var sourcemaps = require("gulp-sourcemaps");


var typescriptCompile = function (file, done) {
    const tsProject = typescript.createProject("tsconfig.json");

    if (file === null) {
        file = srcPaths.typescript + "**/*.ts";
    } else {
        console.log(`Compiling ${ file }`);
    }

    gulp.src(file)
        .pipe(sourcemaps.init())
        .pipe(tsProject())
        .js
        .pipe(sourcemaps.write(".", {
            includeContent: true, mapSources: function (sourcePath) {
                while (sourcePath.startsWith("../")) {
                    sourcePath = sourcePath.replace("../", "");
                }

                return `/${sourcePath}`;
            } }))
        .pipe(gulp.dest(destPaths.app))
        .on("end", done);
};

gulp.task("compile.typescript", function (done) {
    typescriptCompile(null, done);
});
@ivogabe
Copy link
Owner

ivogabe commented Dec 27, 2017

Fixed in #550 and #552

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants