@rollup/plugin-typescript
Advanced tools
Comparing version 11.1.6 to 12.0.0
@@ -411,8 +411,17 @@ 'use strict'; | ||
} | ||
let outputDir = outputOptions.dir; | ||
if (outputOptions.file) { | ||
outputDir = path.dirname(outputOptions.file); | ||
} | ||
for (const dirProperty of DIRECTORY_PROPS) { | ||
if (compilerOptions[dirProperty] && outputOptions.dir) { | ||
if (compilerOptions[dirProperty] && outputDir) { | ||
// Checks if the given path lies within Rollup output dir | ||
const fromRollupDirToTs = path.relative(outputOptions.dir, compilerOptions[dirProperty]); | ||
const fromRollupDirToTs = path.relative(outputDir, compilerOptions[dirProperty]); | ||
if (fromRollupDirToTs.startsWith('..')) { | ||
context.error(`@rollup/plugin-typescript: Path of Typescript compiler option '${dirProperty}' must be located inside Rollup 'dir' option.`); | ||
if (outputOptions.dir) { | ||
context.error(`@rollup/plugin-typescript: Path of Typescript compiler option '${dirProperty}' must be located inside Rollup 'dir' option.`); | ||
} | ||
else { | ||
context.error(`@rollup/plugin-typescript: Path of Typescript compiler option '${dirProperty}' must be located inside the same directory as the Rollup 'file' option.`); | ||
} | ||
} | ||
@@ -890,14 +899,4 @@ } | ||
else if (outputOptions.file) { | ||
// find common path of output.file and configured declation output | ||
const outputDir = path__namespace.dirname(outputOptions.file); | ||
const configured = path__namespace.resolve(parsedOptions.options.declarationDir || | ||
parsedOptions.options.outDir || | ||
tsconfig || | ||
process.cwd()); | ||
const backwards = path__namespace | ||
.relative(outputDir, configured) | ||
.split(path__namespace.sep) | ||
.filter((v) => v === '..') | ||
.join(path__namespace.sep); | ||
baseDir = path__namespace.normalize(`${outputDir}/${backwards}`); | ||
// the bundle output directory used by rollup when outputOptions.file is used instead of outputOptions.dir | ||
baseDir = path__namespace.dirname(outputOptions.file); | ||
} | ||
@@ -904,0 +903,0 @@ if (!baseDir) |
@@ -411,8 +411,17 @@ 'use strict'; | ||
} | ||
let outputDir = outputOptions.dir; | ||
if (outputOptions.file) { | ||
outputDir = path.dirname(outputOptions.file); | ||
} | ||
for (const dirProperty of DIRECTORY_PROPS) { | ||
if (compilerOptions[dirProperty] && outputOptions.dir) { | ||
if (compilerOptions[dirProperty] && outputDir) { | ||
// Checks if the given path lies within Rollup output dir | ||
const fromRollupDirToTs = path.relative(outputOptions.dir, compilerOptions[dirProperty]); | ||
const fromRollupDirToTs = path.relative(outputDir, compilerOptions[dirProperty]); | ||
if (fromRollupDirToTs.startsWith('..')) { | ||
context.error(`@rollup/plugin-typescript: Path of Typescript compiler option '${dirProperty}' must be located inside Rollup 'dir' option.`); | ||
if (outputOptions.dir) { | ||
context.error(`@rollup/plugin-typescript: Path of Typescript compiler option '${dirProperty}' must be located inside Rollup 'dir' option.`); | ||
} | ||
else { | ||
context.error(`@rollup/plugin-typescript: Path of Typescript compiler option '${dirProperty}' must be located inside the same directory as the Rollup 'file' option.`); | ||
} | ||
} | ||
@@ -890,14 +899,4 @@ } | ||
else if (outputOptions.file) { | ||
// find common path of output.file and configured declation output | ||
const outputDir = path__namespace.dirname(outputOptions.file); | ||
const configured = path__namespace.resolve(parsedOptions.options.declarationDir || | ||
parsedOptions.options.outDir || | ||
tsconfig || | ||
process.cwd()); | ||
const backwards = path__namespace | ||
.relative(outputDir, configured) | ||
.split(path__namespace.sep) | ||
.filter((v) => v === '..') | ||
.join(path__namespace.sep); | ||
baseDir = path__namespace.normalize(`${outputDir}/${backwards}`); | ||
// the bundle output directory used by rollup when outputOptions.file is used instead of outputOptions.dir | ||
baseDir = path__namespace.dirname(outputOptions.file); | ||
} | ||
@@ -904,0 +903,0 @@ if (!baseDir) |
@@ -388,8 +388,17 @@ import * as path from 'path'; | ||
} | ||
let outputDir = outputOptions.dir; | ||
if (outputOptions.file) { | ||
outputDir = dirname(outputOptions.file); | ||
} | ||
for (const dirProperty of DIRECTORY_PROPS) { | ||
if (compilerOptions[dirProperty] && outputOptions.dir) { | ||
if (compilerOptions[dirProperty] && outputDir) { | ||
// Checks if the given path lies within Rollup output dir | ||
const fromRollupDirToTs = relative(outputOptions.dir, compilerOptions[dirProperty]); | ||
const fromRollupDirToTs = relative(outputDir, compilerOptions[dirProperty]); | ||
if (fromRollupDirToTs.startsWith('..')) { | ||
context.error(`@rollup/plugin-typescript: Path of Typescript compiler option '${dirProperty}' must be located inside Rollup 'dir' option.`); | ||
if (outputOptions.dir) { | ||
context.error(`@rollup/plugin-typescript: Path of Typescript compiler option '${dirProperty}' must be located inside Rollup 'dir' option.`); | ||
} | ||
else { | ||
context.error(`@rollup/plugin-typescript: Path of Typescript compiler option '${dirProperty}' must be located inside the same directory as the Rollup 'file' option.`); | ||
} | ||
} | ||
@@ -867,14 +876,4 @@ } | ||
else if (outputOptions.file) { | ||
// find common path of output.file and configured declation output | ||
const outputDir = path.dirname(outputOptions.file); | ||
const configured = path.resolve(parsedOptions.options.declarationDir || | ||
parsedOptions.options.outDir || | ||
tsconfig || | ||
process.cwd()); | ||
const backwards = path | ||
.relative(outputDir, configured) | ||
.split(path.sep) | ||
.filter((v) => v === '..') | ||
.join(path.sep); | ||
baseDir = path.normalize(`${outputDir}/${backwards}`); | ||
// the bundle output directory used by rollup when outputOptions.file is used instead of outputOptions.dir | ||
baseDir = path.dirname(outputOptions.file); | ||
} | ||
@@ -881,0 +880,0 @@ if (!baseDir) |
{ | ||
"name": "@rollup/plugin-typescript", | ||
"version": "11.1.6", | ||
"version": "12.0.0", | ||
"publishConfig": { | ||
@@ -5,0 +5,0 @@ "access": "public" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
133973
2786