Skip to content

Commit ccb694d

Browse files
authored
More clearly present change to previous example
1 parent 0130875 commit ccb694d

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

frontend/encore/typescript.rst

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,25 @@ Any ``.ts`` files that you require will be processed correctly. You can
2828
also configure the `ts-loader options`_ via the ``enableTypeScriptLoader()``
2929
method.
3030

31-
.. code-block:: javascript
31+
.. code-block:: diff
3232
3333
Encore
34-
.enableTypeScriptLoader(function(tsConfig) {
35-
// You can use this callback function to adjust ts-loader settings
36-
// https://github.com/TypeStrong/ts-loader/blob/master/README.md#loader-options
37-
// For example:
38-
// tsConfig.silent = false
39-
})
34+
// ...
35+
.addEntry('main', './assets/main.ts')
36+
37+
- .enableTypeScriptLoader()
38+
+ .enableTypeScriptLoader(function(tsConfig) {
39+
+ // You can use this callback function to adjust ts-loader settings
40+
+ // https://github.com/TypeStrong/ts-loader/blob/master/README.md#loader-options
41+
+ // For example:
42+
+ // tsConfig.silent = false
43+
+ })
44+
45+
// optionally enable forked type script for faster builds
46+
// https://www.npmjs.com/package/fork-ts-checker-webpack-plugin
47+
// requires that you have a tsconfig.json file that is setup correctly.
48+
//.enableForkedTypeScriptTypesChecking()
49+
;
4050
4151
See the `Encore's index.js file`_ for detailed documentation and check
4252
out the `tsconfig.json reference`_ and the `Webpack guide about Typescript`_.

0 commit comments

Comments
 (0)