Skip to content

Commit 48e399f

Browse files
authored
docs: clarify Declarations (.d.ts) section in the README (#1495)
1 parent b4b0363 commit 48e399f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,13 @@ don't directly use them. Instead you require them at [split points](https://webp
219219

220220
[TypeScript 2.4 provides support for ECMAScript's new `import()` calls. These calls import a module and return a promise to that module.](https://blogs.msdn.microsoft.com/typescript/2017/06/12/announcing-typescript-2-4-rc/) This is also supported in webpack - details on usage can be found [here](https://webpack.js.org/guides/code-splitting-async/#dynamic-import-import-). Happy code splitting!
221221

222-
### Declarations (.d.ts)
222+
### Declaration Files (.d.ts)
223223

224-
To output a built .d.ts file, you can set `"declaration": true` in your tsconfig, and use the [DeclarationBundlerPlugin](https://www.npmjs.com/package/declaration-bundler-webpack-plugin) in your webpack config.
224+
To output declaration files (.d.ts), you can set "declaration": true in your tsconfig and set "transpileOnly" to false.
225+
226+
If you use ts-loader with "transpileOnly": true along with [fork-ts-checker-webpack-plugin](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin), you will need to configure fork-ts-checker-webpack-plugin to output definition files, you can learn more on the plugin's documentation page: https://github.com/TypeStrong/fork-ts-checker-webpack-plugin#typescript-options
227+
228+
To output a built .d.ts file, you can use the [DeclarationBundlerPlugin](https://www.npmjs.com/package/declaration-bundler-webpack-plugin) in your webpack config.
225229

226230
### Failing the build on TypeScript compilation error
227231

0 commit comments

Comments
 (0)