Merge branch 'cuyl-fix-missing-file'

This commit is contained in:
ezolenko 2019-03-11 13:59:08 -06:00
commit 4806613ed8
6 changed files with 15 additions and 12 deletions

2
dist/index.d.ts.map vendored
View File

@ -1 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,OAAO,EAAE,UAAU,EAAgG,MAAM,QAAQ,CAAC;AAGlI,QAAA,MAAM,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAgU7C,CAAC;AAEF,eAAe,UAAU,CAAC"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,OAAO,EAAE,UAAU,EAAgG,MAAM,QAAQ,CAAC;AAGlI,QAAA,MAAM,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAiU7C,CAAC;AAEF,eAAe,UAAU,CAAC"}

View File

@ -26625,7 +26625,7 @@ const typescript = (options) => {
cache().done();
generateRound++;
},
_onwrite({ file }) {
_onwrite({ file, dir }) {
if (parsedConfig.options.declaration) {
lodash_2(parsedConfig.fileNames, (name) => {
const key = normalize(name);
@ -26638,6 +26638,7 @@ const typescript = (options) => {
declarations[key] = { type: out.dts, map: out.dtsmap };
});
const bundleFile = file;
const outputDir = dir;
const writeDeclaration = (key, extension, entry) => {
if (!entry)
return;
@ -26647,11 +26648,11 @@ const typescript = (options) => {
let writeToPath;
// If for some reason no 'dest' property exists or if 'useTsconfigDeclarationDir' is given in the plugin options,
// use the path provided by Typescript's LanguageService.
if (!bundleFile || pluginOptions.useTsconfigDeclarationDir)
if ((!bundleFile && !outputDir) || pluginOptions.useTsconfigDeclarationDir)
writeToPath = fileName;
else {
// Otherwise, take the directory name from the path and make sure it is absolute.
const destDirname = path.dirname(bundleFile);
const destDirname = bundleFile ? path.dirname(bundleFile) : outputDir;
const destDirectory = path.isAbsolute(destDirname) ? destDirname : path.join(process.cwd(), destDirname);
writeToPath = path.join(destDirectory, path.relative(process.cwd(), fileName));
}

File diff suppressed because one or more lines are too long

View File

@ -26621,7 +26621,7 @@ const typescript = (options) => {
cache().done();
generateRound++;
},
_onwrite({ file }) {
_onwrite({ file, dir }) {
if (parsedConfig.options.declaration) {
lodash_2(parsedConfig.fileNames, (name) => {
const key = normalize(name);
@ -26634,6 +26634,7 @@ const typescript = (options) => {
declarations[key] = { type: out.dts, map: out.dtsmap };
});
const bundleFile = file;
const outputDir = dir;
const writeDeclaration = (key, extension, entry) => {
if (!entry)
return;
@ -26643,11 +26644,11 @@ const typescript = (options) => {
let writeToPath;
// If for some reason no 'dest' property exists or if 'useTsconfigDeclarationDir' is given in the plugin options,
// use the path provided by Typescript's LanguageService.
if (!bundleFile || pluginOptions.useTsconfigDeclarationDir)
if ((!bundleFile && !outputDir) || pluginOptions.useTsconfigDeclarationDir)
writeToPath = fileName;
else {
// Otherwise, take the directory name from the path and make sure it is absolute.
const destDirname = dirname(bundleFile);
const destDirname = bundleFile ? dirname(bundleFile) : outputDir;
const destDirectory = isAbsolute(destDirname) ? destDirname : join(process.cwd(), destDirname);
writeToPath = join(destDirectory, relative(process.cwd(), fileName));
}

File diff suppressed because one or more lines are too long

View File

@ -283,7 +283,7 @@ const typescript: PluginImpl<Partial<IOptions>> = (options) =>
generateRound++;
},
_onwrite({ file }: OutputOptions): void
_onwrite({ file, dir }: OutputOptions): void
{
if (parsedConfig.options.declaration)
{
@ -300,6 +300,7 @@ const typescript: PluginImpl<Partial<IOptions>> = (options) =>
});
const bundleFile = file;
const outputDir = dir;
const writeDeclaration = (key: string, extension: string, entry?: tsTypes.OutputFile) =>
{
@ -313,12 +314,12 @@ const typescript: PluginImpl<Partial<IOptions>> = (options) =>
let writeToPath: string;
// If for some reason no 'dest' property exists or if 'useTsconfigDeclarationDir' is given in the plugin options,
// use the path provided by Typescript's LanguageService.
if (!bundleFile || pluginOptions.useTsconfigDeclarationDir)
if ((!bundleFile && !outputDir) || pluginOptions.useTsconfigDeclarationDir)
writeToPath = fileName;
else
{
// Otherwise, take the directory name from the path and make sure it is absolute.
const destDirname = dirname(bundleFile);
const destDirname = bundleFile ? dirname(bundleFile) : <string>outputDir;
const destDirectory = isAbsolute(destDirname) ? destDirname : join(process.cwd(), destDirname);
writeToPath = join(destDirectory, relative(process.cwd(), fileName));
}