- using allowNonTsExtensions to let other plugins generate typescript #111

This commit is contained in:
Eugene Zolenko 2018-10-30 10:23:22 -06:00
parent e4fe502c78
commit 3a6079c1ec
8 changed files with 11 additions and 7 deletions

View File

@ -48,6 +48,7 @@ The plugin inherits all compiler options and file lists from your `tsconfig.json
* `outDir`: `./placeholder` in cache root, see [83](https://github.com/ezolenko/rollup-plugin-typescript2/issues/83) and [Microsoft/TypeScript/issues/24715](https://github.com/Microsoft/TypeScript/issues/24715)
* `declarationDir`: `process.cwd()` (*only if `useTsconfigDeclarationDir` is false in the plugin options*)
* `moduleResolution`: `node` (*`classic` is [deprecated](https://www.typescriptlang.org/docs/handbook/module-resolution.html). It also breaks this plugin, see [#12](https://github.com/ezolenko/rollup-plugin-typescript2/issues/12) and [#14](https://github.com/ezolenko/rollup-plugin-typescript2/issues/14)*)
* `allowNonTsExtensions`: true to let other plugins on the chain generate typescript, update plugin's include filter to pick them up (see [#111](https://github.com/ezolenko/rollup-plugin-typescript2/issues/111))
#### Some compiler options have more than one compatible value.

View File

@ -1 +1 @@
{"version":3,"file":"get-options-overrides.d.ts","sourceRoot":"","sources":["src/get-options-overrides.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,wBAAgB,mBAAmB,CAAC,EAAE,yBAAyB,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,iBAAiB,CAAC,EAAE,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,eAAe,CA2B9J"}
{"version":3,"file":"get-options-overrides.d.ts","sourceRoot":"","sources":["src/get-options-overrides.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,wBAAgB,mBAAmB,CAAC,EAAE,yBAAyB,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,iBAAiB,CAAC,EAAE,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,eAAe,CA4B9J"}

View File

@ -19948,6 +19948,7 @@ function getOptionsOverrides({ useTsconfigDeclarationDir, cacheRoot }, preParsed
inlineSourceMap: false,
outDir: `${cacheRoot}/placeholder`,
moduleResolution: tsModule.ModuleResolutionKind.NodeJs,
allowNonTsExtensions: true,
};
if (preParsedTsconfig) {
const declaration = preParsedTsconfig.options.declaration;
@ -21477,7 +21478,7 @@ function typescript(options) {
context.info(`tslib version: ${tslibVersion}`);
if (!semver_30(tsModule.version, ">=2.4.0", { includePrerelease: true }))
throw new Error(`Installed typescript version '${tsModule.version}' is outside of supported range '>=2.4.0'`);
context.info(`rollup-plugin-typescript2 version: 0.17.3`);
context.info(`rollup-plugin-typescript2 version: 0.18.0`);
context.debug(() => `plugin options:\n${JSON.stringify(pluginOptions, (key, value) => key === "typescript" ? `version ${value.version}` : value, 4)}`);
context.debug(() => `rollup config:\n${JSON.stringify(rollupOptions, undefined, 4)}`);
watchMode = process.env.ROLLUP_WATCH === "true";

File diff suppressed because one or more lines are too long

View File

@ -19944,6 +19944,7 @@ function getOptionsOverrides({ useTsconfigDeclarationDir, cacheRoot }, preParsed
inlineSourceMap: false,
outDir: `${cacheRoot}/placeholder`,
moduleResolution: tsModule.ModuleResolutionKind.NodeJs,
allowNonTsExtensions: true,
};
if (preParsedTsconfig) {
const declaration = preParsedTsconfig.options.declaration;
@ -21473,7 +21474,7 @@ function typescript(options) {
context.info(`tslib version: ${tslibVersion}`);
if (!semver_30(tsModule.version, ">=2.4.0", { includePrerelease: true }))
throw new Error(`Installed typescript version '${tsModule.version}' is outside of supported range '>=2.4.0'`);
context.info(`rollup-plugin-typescript2 version: 0.17.3`);
context.info(`rollup-plugin-typescript2 version: 0.18.0`);
context.debug(() => `plugin options:\n${JSON.stringify(pluginOptions, (key, value) => key === "typescript" ? `version ${value.version}` : value, 4)}`);
context.debug(() => `rollup config:\n${JSON.stringify(rollupOptions, undefined, 4)}`);
watchMode = process.env.ROLLUP_WATCH === "true";

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "rollup-plugin-typescript2",
"version": "0.17.3",
"version": "0.18.0",
"description": "Seamless integration between Rollup and TypeScript. Now with errors.",
"main": "dist/rollup-plugin-typescript2.cjs.js",
"module": "dist/rollup-plugin-typescript2.es.js",
@ -40,7 +40,7 @@
"typescript": ">=2.4.0"
},
"devDependencies": {
"typescript": "3.1.3",
"typescript": "3.1.4",
"object-hash": "1.3.0",
"colors": "1.3.2",
"graphlib": "2.1.5",

View File

@ -13,6 +13,7 @@ export function getOptionsOverrides({ useTsconfigDeclarationDir, cacheRoot }: IO
inlineSourceMap: false,
outDir: `${cacheRoot}/placeholder`, // need an outdir that is different from source or tsconfig parsing trips up. https://github.com/Microsoft/TypeScript/issues/24715
moduleResolution: tsModule.ModuleResolutionKind.NodeJs,
allowNonTsExtensions: true,
};
if (preParsedTsconfig)