Skip to content

Commit 36f346c

Browse files
committed
Add vinyl to dependency list and prevent empty base string, fix #561
1 parent 473b0ed commit 36f346c

File tree

4 files changed

+58
-13
lines changed

4 files changed

+58
-13
lines changed

lib/compiler.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,12 @@ export class ProjectCompiler implements ICompiler {
169169
base = this.project.directory;
170170
baseDeclarations = base;
171171
} else {
172-
const outFile = this.project.options.out;
173-
base = jsFileName.substring(0, jsFileName.length - outFile.length);
172+
base = this.project.directory;
174173
baseDeclarations = base;
174+
jsFileName = path.resolve(base, jsFileName);
175+
if (dtsFileName !== undefined) {
176+
dtsFileName = path.resolve(base, dtsFileName);
177+
}
175178
}
176179

177180
if (jsContent !== undefined) {

package-lock.json

Lines changed: 40 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@
6565
"plugin-error": "^0.1.2",
6666
"source-map": "^0.6.1",
6767
"through2": "^2.0.3",
68-
"vinyl-fs": "^3.0.0"
68+
"vinyl-fs": "^3.0.0",
69+
"vinyl": "^2.1.0"
6970
},
7071
"devDependencies": {
7172
"@types/ansi-colors": "^1.0.0",

release/compiler.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,24 @@ var ProjectCompiler = /** @class */ (function () {
118118
var baseRelative = path.relative(this.project.options.rootDir, file.gulp.base);
119119
baseDeclarations = path.join(this.project.options.declarationDir, baseRelative);
120120
}
121+
if (base === '')
122+
console.log(1, file.gulp.base, this.project.options.outDir);
121123
}
122124
else if (this.project.options.outFile) {
123125
base = this.project.directory;
124126
baseDeclarations = base;
127+
if (base === '')
128+
console.log(2, this.project);
125129
}
126130
else {
127-
var outFile = this.project.options.out;
128-
base = jsFileName.substring(0, jsFileName.length - outFile.length);
131+
base = this.project.directory;
129132
baseDeclarations = base;
133+
jsFileName = path.resolve(base, jsFileName);
134+
if (dtsFileName !== undefined) {
135+
dtsFileName = path.resolve(base, dtsFileName);
136+
}
137+
if (base === '')
138+
console.log(3, this.project.options.out, jsFileName);
130139
}
131140
if (jsContent !== undefined) {
132141
if (jsMapContent !== undefined) {

0 commit comments

Comments
 (0)