Skip to content

Commit

Permalink
- using allowNonTsExtensions to let other plugins generate typescript #…
Browse files Browse the repository at this point in the history
  • Loading branch information
ezolenko committed Oct 30, 2018
1 parent e4fe502 commit 3a6079c
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion dist/get-options-overrides.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion dist/rollup-plugin-typescript2.cjs.js
Expand Up @@ -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;
Expand Down Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion dist/rollup-plugin-typescript2.cjs.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion dist/rollup-plugin-typescript2.es.js
Expand Up @@ -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;
Expand Down Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion dist/rollup-plugin-typescript2.es.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
@@ -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",
Expand Down Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/get-options-overrides.ts
Expand Up @@ -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)
Expand Down

0 comments on commit 3a6079c

Please sign in to comment.