mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-19 01:57:55 +08:00
Added ability to override TypeScript options from asset manifest.
This commit is contained in:
@@ -213,9 +213,11 @@ function buildJsPipeline(assetGroup, doConcat, doRebuild) {
|
|||||||
// Source maps are useless if neither concatenating nor transpiling.
|
// Source maps are useless if neither concatenating nor transpiling.
|
||||||
if ((!doConcat || assetGroup.inputPaths.length < 2) && !assetGroup.inputPaths.some(function (inputPath) { return path.extname(inputPath).toLowerCase() === ".ts"; }))
|
if ((!doConcat || assetGroup.inputPaths.length < 2) && !assetGroup.inputPaths.some(function (inputPath) { return path.extname(inputPath).toLowerCase() === ".ts"; }))
|
||||||
generateSourceMaps = false;
|
generateSourceMaps = false;
|
||||||
var typescriptOptions = { allowJs: true, noImplicitAny: true, noEmitOnError: true };
|
var typeScriptOptions = { allowJs: true, noImplicitAny: true, noEmitOnError: true };
|
||||||
|
if (assetGroup.typeScriptOptions)
|
||||||
|
typeScriptOptions = Object.assign(typeScriptOptions, assetGroup.typeScriptOptions); // Merge override options from asset group if any.
|
||||||
if (doConcat)
|
if (doConcat)
|
||||||
typescriptOptions.outFile = assetGroup.outputFileName;
|
typeScriptOptions.outFile = assetGroup.outputFileName;
|
||||||
return gulp.src(assetGroup.inputPaths)
|
return gulp.src(assetGroup.inputPaths)
|
||||||
.pipe(gulpif(!doRebuild,
|
.pipe(gulpif(!doRebuild,
|
||||||
gulpif(doConcat,
|
gulpif(doConcat,
|
||||||
@@ -226,7 +228,7 @@ function buildJsPipeline(assetGroup, doConcat, doRebuild) {
|
|||||||
}))))
|
}))))
|
||||||
.pipe(plumber())
|
.pipe(plumber())
|
||||||
.pipe(gulpif(generateSourceMaps, sourcemaps.init()))
|
.pipe(gulpif(generateSourceMaps, sourcemaps.init()))
|
||||||
.pipe(typescript(typescriptOptions))
|
.pipe(typescript(typeScriptOptions))
|
||||||
.pipe(header(
|
.pipe(header(
|
||||||
"/*\n" +
|
"/*\n" +
|
||||||
"** NOTE: This file is generated by Gulp and should not be edited directly!\n" +
|
"** NOTE: This file is generated by Gulp and should not be edited directly!\n" +
|
||||||
|
Reference in New Issue
Block a user