You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 3. add getCustomTransformer method to the loader config
41
41
var config = {
@@ -56,17 +56,20 @@ var config = {
56
56
};
57
57
```
58
58
59
+
Please note, that in the development mode, `awesome-typescript-loader` uses multiple separate processes to speed up compilation. In that mode the above configuration cannot work because functions, which `getCustomTransformers` is, are not transferrable between processes.
60
+
To solve this please refer to [Forked process configuration](#forked-process-configuration) section.
61
+
59
62
## `ts-loader`
60
63
61
64
In the `webpack.config.js` file in the section where **ts-loader** is configured as a loader:
62
65
63
66
```js
64
67
// 1. import default from the plugin module
65
-
var createStyledComponentsTransformer =require('typescript-plugin-styled-components').default;
// 3. add getCustomTransformer method to the loader config
72
75
var config = {
@@ -87,6 +90,44 @@ var config = {
87
90
};
88
91
```
89
92
93
+
Please note, when `awesome-typescript-loader` is used with `HappyPack` or `thread-loader`, they use multiple separate processes to speed up compilation. In that mode the above configuration cannot work because functions, which `getCustomTransformers` is, are not transferrable between processes.
94
+
To solve this please refer to [Forked process configuration](#forked-process-configuration) section.
95
+
96
+
## Forked process configuration
97
+
98
+
To configure the transformer for development mode in `awesome-typescript-loader` or `ts-loader` with `HappyPack` or `thread-loader`, you need to make `getCustomTransformers` a resolvoble module name instead of the function. Since the configuration is very similar, here's an example:
99
+
100
+
### 1. Move `styledComponentsTransformer` into a separate file
101
+
102
+
Let's assume it is in the same folder as your `webpack.config` and has name `webpack.ts-transformers.js`:
0 commit comments