@rollup/plugin-typescript
Advanced tools
Comparing version 8.2.5 to 8.3.0
# @rollup/plugin-typescript ChangeLog | ||
## v8.3.0 | ||
_2021-10-15_ | ||
### Features | ||
- feat: add resolve options (#1015) | ||
## v8.2.5 | ||
@@ -4,0 +12,0 @@ |
@@ -115,7 +115,8 @@ import path, { resolve as resolve$1, dirname, relative, win32, posix, normalize } from 'path'; | ||
const getPluginOptions = (options) => { | ||
const { cacheDir, exclude, include, transformers, tsconfig, tslib, typescript, outputToFilesystem } = options, compilerOptions = __rest(options, ["cacheDir", "exclude", "include", "transformers", "tsconfig", "tslib", "typescript", "outputToFilesystem"]); | ||
const filter = createFilter(include || ['*.ts+(|x)', '**/*.ts+(|x)'], exclude); | ||
const { cacheDir, exclude, include, filterRoot, transformers, tsconfig, tslib, typescript, outputToFilesystem } = options, compilerOptions = __rest(options, ["cacheDir", "exclude", "include", "filterRoot", "transformers", "tsconfig", "tslib", "typescript", "outputToFilesystem"]); | ||
return { | ||
cacheDir, | ||
filter, | ||
include, | ||
exclude, | ||
filterRoot, | ||
tsconfig, | ||
@@ -692,3 +693,3 @@ compilerOptions: compilerOptions, | ||
function typescript(options = {}) { | ||
const { cacheDir, compilerOptions, filter, transformers, tsconfig, tslib, typescript: ts, outputToFilesystem } = getPluginOptions(options); | ||
const { cacheDir, compilerOptions, exclude, filterRoot, include, outputToFilesystem, transformers, tsconfig, tslib, typescript: ts } = getPluginOptions(options); | ||
const tsCache = new TSCache(cacheDir); | ||
@@ -698,2 +699,5 @@ const emittedFiles = new Map(); | ||
const parsedOptions = parseTypescriptConfig(ts, tsconfig, compilerOptions); | ||
const filter = createFilter(include || ['*.ts+(|x)', '**/*.ts+(|x)'], exclude, { | ||
resolve: filterRoot !== null && filterRoot !== void 0 ? filterRoot : parsedOptions.options.rootDir | ||
}); | ||
parsedOptions.fileNames = parsedOptions.fileNames.filter(filter); | ||
@@ -700,0 +704,0 @@ const formatHost = createFormattingHost(ts, parsedOptions.options); |
@@ -143,7 +143,8 @@ 'use strict'; | ||
const getPluginOptions = (options) => { | ||
const { cacheDir, exclude, include, transformers, tsconfig, tslib, typescript, outputToFilesystem } = options, compilerOptions = __rest(options, ["cacheDir", "exclude", "include", "transformers", "tsconfig", "tslib", "typescript", "outputToFilesystem"]); | ||
const filter = pluginutils.createFilter(include || ['*.ts+(|x)', '**/*.ts+(|x)'], exclude); | ||
const { cacheDir, exclude, include, filterRoot, transformers, tsconfig, tslib, typescript, outputToFilesystem } = options, compilerOptions = __rest(options, ["cacheDir", "exclude", "include", "filterRoot", "transformers", "tsconfig", "tslib", "typescript", "outputToFilesystem"]); | ||
return { | ||
cacheDir, | ||
filter, | ||
include, | ||
exclude, | ||
filterRoot, | ||
tsconfig, | ||
@@ -720,3 +721,3 @@ compilerOptions: compilerOptions, | ||
function typescript(options = {}) { | ||
const { cacheDir, compilerOptions, filter, transformers, tsconfig, tslib, typescript: ts, outputToFilesystem } = getPluginOptions(options); | ||
const { cacheDir, compilerOptions, exclude, filterRoot, include, outputToFilesystem, transformers, tsconfig, tslib, typescript: ts } = getPluginOptions(options); | ||
const tsCache = new TSCache(cacheDir); | ||
@@ -726,2 +727,5 @@ const emittedFiles = new Map(); | ||
const parsedOptions = parseTypescriptConfig(ts, tsconfig, compilerOptions); | ||
const filter = pluginutils.createFilter(include || ['*.ts+(|x)', '**/*.ts+(|x)'], exclude, { | ||
resolve: filterRoot !== null && filterRoot !== void 0 ? filterRoot : parsedOptions.options.rootDir | ||
}); | ||
parsedOptions.fileNames = parsedOptions.fileNames.filter(filter); | ||
@@ -728,0 +732,0 @@ const formatHost = createFormattingHost(ts, parsedOptions.options); |
{ | ||
"name": "@rollup/plugin-typescript", | ||
"version": "8.2.5", | ||
"version": "8.3.0", | ||
"publishConfig": { | ||
@@ -5,0 +5,0 @@ "access": "public" |
@@ -82,2 +82,13 @@ [npm]: https://img.shields.io/npm/v/@rollup/plugin-typescript | ||
### `filterRoot` | ||
Type: `String` | `Boolean`<br> | ||
Default: `rootDir` ?? `tsConfig.compilerOptions.rootDir` ?? `process.cwd()` | ||
Optionally resolves the include and exclude patterns against a directory other than `process.cwd()`. If a String is specified, then the value will be used as the base directory. Relative paths will be resolved against `process.cwd()` first. If `false`, then the patterns will not be resolved against any directory. | ||
By default, patterns resolve against the rootDir set in your TS config file. | ||
This can fix plugin errors when parsing files outside the current working directory (process.cwd()). | ||
### `tsconfig` | ||
@@ -84,0 +95,0 @@ |
@@ -55,2 +55,7 @@ /* eslint-disable no-use-before-define */ | ||
/** | ||
* Sets the `resolve` value for the underlying filter function. If not set will use the `rootDir` property | ||
* @see {@link https://github.com/rollup/plugins/tree/master/packages/pluginutils#createfilter} @rollup/pluginutils `createFilter` | ||
*/ | ||
filterRoot?: string | false; | ||
/** | ||
* When set to false, ignores any options specified in the config file. | ||
@@ -57,0 +62,0 @@ * If set to a string that corresponds to a file path, the specified file |
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
95471
1689
346