now parsing compiler options correctly
This commit is contained in:
18
dist/npmts.compile.js
vendored
18
dist/npmts.compile.js
vendored
@ -7,16 +7,22 @@ var promiseArray = [];
|
||||
var compileTs = function (tsFileArrayArg, tsOptionsArg) {
|
||||
if (tsOptionsArg === void 0) { tsOptionsArg = {}; }
|
||||
var done = plugins.Q.defer();
|
||||
var tsOptionsDefault = {
|
||||
var compilerOptionsDefault = {
|
||||
declaration: true,
|
||||
target: "ES6",
|
||||
module: "commonjs"
|
||||
module: "CommonJS",
|
||||
target: "ES6"
|
||||
};
|
||||
/**
|
||||
* merges default ts options with those found in npmts.json
|
||||
*/
|
||||
var tsOptions = function (keyArg) {
|
||||
return plugins.lodashObject.assign(tsOptionsDefault, tsOptionsArg);
|
||||
var compilerOptions = function (keyArg) {
|
||||
var tsOptionsCombined = plugins.lodashObject.merge(compilerOptionsDefault, tsOptionsArg);
|
||||
var compilerOptions = {
|
||||
declaration: tsOptionsCombined.declaration,
|
||||
module: plugins.tsn.ModuleKind[tsOptionsCombined.module],
|
||||
target: plugins.tsn.ScriptTarget[tsOptionsCombined.target]
|
||||
};
|
||||
return compilerOptions;
|
||||
};
|
||||
var _loop_1 = function(keyArg) {
|
||||
plugins.beautylog.info("TypeScript assignment: transpile from " + keyArg.blue + " to " + tsFileArrayArg[keyArg].blue);
|
||||
@ -25,7 +31,7 @@ var compileTs = function (tsFileArrayArg, tsOptionsArg) {
|
||||
.then(function (filesToConvertArg) {
|
||||
var filesToConvertAbsolute = plugins.smartpath.transform.toAbsolute(filesToConvertArg, process.cwd());
|
||||
var destDir = plugins.smartpath.transform.toAbsolute(tsFileArrayArg[keyArg], process.cwd());
|
||||
var filesCompiledPromise = plugins.tsn.compile(filesToConvertAbsolute, destDir);
|
||||
var filesCompiledPromise = plugins.tsn.compile(filesToConvertAbsolute, destDir, compilerOptions(keyArg));
|
||||
promiseArray.push(filesCompiledPromise);
|
||||
});
|
||||
promiseArray.push(filesReadPromise);
|
||||
|
2
dist/npmts.plugins.d.ts
vendored
2
dist/npmts.plugins.d.ts
vendored
@ -11,7 +11,7 @@ export declare let g: {
|
||||
sourcemaps: any;
|
||||
typedoc: any;
|
||||
};
|
||||
export declare let lodashObject: any;
|
||||
export import lodashObject = require('lodash');
|
||||
export import npmextra = require("npmextra");
|
||||
export import projectinfo = require("projectinfo");
|
||||
export import path = require("path");
|
||||
|
2
dist/npmts.plugins.js
vendored
2
dist/npmts.plugins.js
vendored
@ -12,7 +12,7 @@ exports.g = {
|
||||
sourcemaps: require("gulp-sourcemaps"),
|
||||
typedoc: require("gulp-typedoc")
|
||||
};
|
||||
exports.lodashObject = require('lodash/fp/object');
|
||||
exports.lodashObject = require('lodash');
|
||||
exports.npmextra = require("npmextra");
|
||||
exports.projectinfo = require("projectinfo");
|
||||
exports.path = require("path");
|
||||
|
Reference in New Issue
Block a user