@@ -50,65 +50,63 @@ This is why we've created this plugin. To provide better performance, plugin reu
50
50
these trees with tslint. It can be scaled with a multi-process mode to utilize maximum CPU power.
51
51
52
52
## Modules resolution
53
- It's very important to be aware that this plugin uses [ typescript] ( https://github.com/Microsoft/TypeScript ) 's, not
54
- [ webpack] ( https://github.com/webpack/webpack ) 's modules resolution. It means that you have to setup ` tsconfig.json ` correctly. For example
53
+ It's very important to be aware that ** this plugin uses [ typescript] ( https://github.com/Microsoft/TypeScript ) 's, not
54
+ [ webpack] ( https://github.com/webpack/webpack ) 's modules resolution** . It means that you have to setup ` tsconfig.json ` correctly. For example
55
55
if you set ` files: ['./src/someFile.ts'] ` in ` tsconfig.json ` , this plugin will check only ` someFile.ts ` for semantic errors. It's because
56
- of performance. The goal of this plugin is to be as fast as possible. With typescript's module resolution we don't have to wait for webpack
56
+ of performance. The goal of this plugin is to be * as fast as possible* . With typescript's module resolution we don't have to wait for webpack
57
57
to compile files (which traverses dependency graph during compilation) - we have a full list of files from the begin.
58
58
59
59
To debug typescript's modules resolution, you can use ` tsc --traceResolution ` command.
60
60
61
61
## TSLint
62
62
If you have installed [ tslint] ( https://palantir.github.io/tslint ) , it's enabled by default. To disable it, set ` tslint: false ` in plugin
63
- options. We recommend changing ` defaultSeverity ` to the ` warning ` in ` tslint.json ` file. It helps to distinguish lints from typescript's
63
+ options. We recommend changing ` defaultSeverity ` to the ` " warning" ` in ` tslint.json ` file. It helps to distinguish lints from typescript's
64
64
diagnostics.
65
65
66
66
## Options
67
- #### tsconfig ` string `
67
+ * ** tsconfig** ` string ` :
68
68
Path to tsconfig.json file. Default: ` path.resolve(compiler.options.context, './tsconfig.json') `
69
69
70
- #### tslint ` string | false `
70
+ * ** tslint** ` string | false ` :
71
71
Path to tslint.json file. If ` false ` , disables tslint. Default: ` path.resolve(compiler.options.context, './tslint.json') `
72
72
73
- #### watch ` string | string[] `
73
+ * ** watch** ` string | string[] ` :
74
74
Directories or files to watch by service. Not necessary but improves performance (reduces number of ` fs.stat ` calls).
75
75
76
- #### blockEmit ` boolean `
76
+ * ** blockEmit** ` boolean ` :
77
77
If ` true ` , plugin will block emit until check will be done. It's good setting for ci/production build because webpack will return code != 0
78
78
if there are type/lint errors. Default: ` false ` .
79
79
80
- #### ignoreDiagnostics ` number[] `
80
+ * ** ignoreDiagnostics** ` number[] ` :
81
81
List of typescript diagnostic codes to ignore.
82
82
83
- #### ignoreLints ` string[] `
83
+ * ** ignoreLints** ` string[] ` :
84
84
List of tslint rule names to ignore.
85
85
86
- #### colors ` boolean `
86
+ * ** colors** ` boolean ` :
87
87
If ` false ` , disables built-in colors in logger messages. Default: ` true ` .
88
88
89
- #### logger ` object `
89
+ * ** logger** ` object ` :
90
90
Logger instance. It should be object that implements method: ` error ` , ` warn ` , ` info ` . Default: ` console ` .
91
91
92
- #### silent ` boolean `
92
+ * ** silent** ` boolean ` :
93
93
If ` true ` , logger will not be used. Default: ` false ` .
94
94
95
- #### workers ` number `
95
+ * ** memoryLimit** ` number ` :
96
+ Memory limit for service process in MB. If service exits with allocation failed error, increase this number. Default: ` 2048 ` .
97
+
98
+ * ** workers** ` number ` :
96
99
You can split type checking to a few workers to speed-up increment build. ** Be careful** - if you don't want to increase build time, you
97
100
should keep free 1 core for * build* and 1 core for a * system* * (for example system with 4 CPUs should use max 2 workers)* . Second thing -
98
101
node doesn't share memory between workers - keep in mind that memory usage will increase. Be aware that in some scenarios increasing workers
99
- number ** can increase checking time** .
100
-
101
- Default: ` ForkTsCheckerWebpackPlugin.ONE_CPU ` .
102
+ number ** can increase checking time** . Default: ` ForkTsCheckerWebpackPlugin.ONE_CPU ` .
102
103
103
- Pre-computed consts:
104
+ ### Pre-computed consts:
104
105
* ` ForkTsCheckerWebpackPlugin.ONE_CPU ` - always use one CPU
105
106
* ` ForkTsCheckerWebpackPlugin.ALL_CPUS ` - always use all CPUs (will increase build time)
106
107
* ` ForkTsCheckerWebpackPlugin.ONE_CPU_FREE ` - leave only one CPU for build (probably will increase build time)
107
108
* ` ForkTsCheckerWebpackPlugin.TWO_CPUS_FREE ` - ** recommended** - leave two CPUs free (one for build, one for system)
108
109
109
- #### memoryLimit ` number `
110
- Memory limit for service process in MB. If service exits with allocation failed error, increase this number. Default: ` 2048 ` .
111
-
112
110
## Plugin Hooks
113
111
This plugin provides some custom webpack hooks (all are sync):
114
112
0 commit comments