Closed Akimotorakiyu closed 5 years ago
can't find moudle but .d.ts file has already exist when target option above es5
Expected behavior: no error Actual behavior:
Your gulpfile:
Include your gulpfile, or only the related task (with ts.createProject).
ts.createProject
import * as gulp from "gulp" import * as rename from "gulp-rename" import * as stylus from "gulp-stylus" import * as plumber from "gulp-plumber" import * as autoprefixer from "autoprefixer" import * as postcss from "gulp-postcss" import * as ts from "gulp-typescript" import { FSWatcher } from "fs"; let tsProject = ts.createProject("tsconfig.json"); function acss(done) { gulp.src(`src/**/*.styl`) .pipe(plumber()) .pipe(stylus()) .pipe(postcss([autoprefixer()])) .pipe(rename({ extname: '.acss', })) .pipe(gulp.dest("src")); done(); } function tsc(done) { gulp.src(`src/**/*.ts`) .pipe(tsProject()) .js .pipe(gulp.dest("src")); done(); } console.log("starting gulp task...") gulp.task("default", gulp.parallel(acss, tsc)) console.log("starting watching...") let watcher = <FSWatcher[]>[] watcher.push(gulp.watch(`src/**/*.styl`, acss)) watcher.push(gulp.watch(`src/**/*.ts`, tsc)) watcher.forEach((ele) => { ele.on("change", (fileName, eventType) => { console.log(`${fileName} changed...`) }) })
tsconfig.json
Include your tsconfig, if related to this issue.
{ "compilerOptions": { "target": "es2017", "lib": ["es2017", "dom"], "allowUnusedLabels": true, }, }
https://github.com/microsoft/TypeScript/issues/31405
can't find moudle but .d.ts file has already exist when target option above es5
Expected behavior: no error Actual behavior:
Your gulpfile:
Include your gulpfile, or only the related task (with
ts.createProject
).tsconfig.json
Include your tsconfig, if related to this issue.