build: no strict when build (#3373)

This commit is contained in:
三咲智子 2021-09-13 13:14:39 +08:00 committed by GitHub
parent 0bcebf5e18
commit f538abae77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,26 +3,30 @@ import ts from 'gulp-typescript'
import path from 'path'
import { buildOutput } from '../../build/paths'
import type { Settings } from 'gulp-typescript'
export const esm = './es'
export const cjs = './lib'
const inputs = ['./**/*.ts', '!gulpfile.ts', '!./node_modules', '!./tests/*.ts']
function createProject(settings: Settings = {}) {
return ts.createProject('tsconfig.json', {
// temporarily disabled
// TODO: remove this
strict: false,
...settings,
})
}
function compileEsm() {
return gulp
.src(inputs)
.pipe(ts.createProject('tsconfig.json')())
.pipe(gulp.dest(esm))
return gulp.src(inputs).pipe(createProject()()).pipe(gulp.dest(esm))
}
function compileCjs() {
return gulp
.src(inputs)
.pipe(
ts.createProject('tsconfig.json', {
module: 'commonjs',
})()
)
.pipe(createProject({ module: 'commonjs' })())
.pipe(gulp.dest(cjs))
}