Skip to content

Commit

Permalink
Add vinyl to dependency list and prevent empty base string, fix #561
Browse files Browse the repository at this point in the history
  • Loading branch information
ivogabe committed Feb 8, 2018
1 parent 473b0ed commit 36f346c
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 13 deletions.
7 changes: 5 additions & 2 deletions lib/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,12 @@ export class ProjectCompiler implements ICompiler {
base = this.project.directory;
baseDeclarations = base;
} else {
const outFile = this.project.options.out;
base = jsFileName.substring(0, jsFileName.length - outFile.length);
base = this.project.directory;
baseDeclarations = base;
jsFileName = path.resolve(base, jsFileName);
if (dtsFileName !== undefined) {
dtsFileName = path.resolve(base, dtsFileName);
}
}

if (jsContent !== undefined) {
Expand Down
48 changes: 40 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
"plugin-error": "^0.1.2",
"source-map": "^0.6.1",
"through2": "^2.0.3",
"vinyl-fs": "^3.0.0"
"vinyl-fs": "^3.0.0",
"vinyl": "^2.1.0"
},
"devDependencies": {
"@types/ansi-colors": "^1.0.0",
Expand Down
13 changes: 11 additions & 2 deletions release/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,24 @@ var ProjectCompiler = /** @class */ (function () {
var baseRelative = path.relative(this.project.options.rootDir, file.gulp.base);
baseDeclarations = path.join(this.project.options.declarationDir, baseRelative);
}
if (base === '')
console.log(1, file.gulp.base, this.project.options.outDir);
}
else if (this.project.options.outFile) {
base = this.project.directory;
baseDeclarations = base;
if (base === '')
console.log(2, this.project);
}
else {
var outFile = this.project.options.out;
base = jsFileName.substring(0, jsFileName.length - outFile.length);
base = this.project.directory;
baseDeclarations = base;
jsFileName = path.resolve(base, jsFileName);
if (dtsFileName !== undefined) {
dtsFileName = path.resolve(base, dtsFileName);
}
if (base === '')
console.log(3, this.project.options.out, jsFileName);
}
if (jsContent !== undefined) {
if (jsMapContent !== undefined) {
Expand Down

0 comments on commit 36f346c

Please sign in to comment.