Skip to content

Commit c227e1f

Browse files
authored
docs: add thread-loader warnings (#5777) [ci skip]
1 parent a1ee583 commit c227e1f

File tree

5 files changed

+12
-0
lines changed

5 files changed

+12
-0
lines changed

docs/config/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,10 @@ In v3 this means the opposite of `css.requireModuleExtension`.
380380

381381
Whether to use `thread-loader` for Babel or TypeScript transpilation. This is enabled for production builds when the system has more than 1 CPU cores. Passing a number will define the amount of workers used.
382382

383+
::: warning
384+
Do not use `parallel` in combination with non-serializable loader options, such as regexes, dates and functions. These options would not be passed correctly to the respective loaders which may lead to unexpected errors.
385+
:::
386+
383387
### pwa
384388

385389
- Type: `Object`

docs/core-plugins/babel.md

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ module.exports = {
2626

2727
[thread-loader](https://github.com/webpack-contrib/thread-loader) is enabled by default when the machine has more than 1 CPU cores. This can be turned off by setting `parallel: false` in `vue.config.js`.
2828

29+
`parallel` should be set to `false` when using Babel in combination with non-serializable loader options, such as regexes, dates and functions. These options would not be passed correctly to `babel-loader` which may lead to unexpected errors.
30+
2931
## Installing in an Already Created Project
3032

3133
``` sh

docs/core-plugins/typescript.md

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ If opted to use [TSLint](https://palantir.github.io/tslint/) during project crea
2424

2525
[thread-loader](https://github.com/webpack-contrib/thread-loader) is enabled by default when the machine has more than 1 CPU cores. This can be turned off by setting `parallel: false` in `vue.config.js`.
2626

27+
`parallel` should be set to `false` when using Typescript in combination with non-serializable loader options, such as regexes, dates and functions. These options would not be passed correctly to `ts-loader` which may lead to unexpected errors.
28+
2729
## Installing in an Already Created Project
2830

2931
``` sh

packages/@vue/cli-plugin-babel/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ module.exports = {
2626

2727
[thread-loader](https://github.com/webpack-contrib/thread-loader) is enabled by default when the machine has more than 1 CPU cores. This can be turned off by setting `parallel: false` in `vue.config.js`.
2828

29+
`parallel` should be set to `false` when using Babel in combination with non-serializable loader options, such as regexes, dates and functions. These options would not be passed correctly to `babel-loader` which may lead to unexpected errors.
30+
2931
## Installing in an Already Created Project
3032

3133
``` sh

packages/@vue/cli-plugin-typescript/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ If opted to use [TSLint](https://palantir.github.io/tslint/) during project crea
2424

2525
[thread-loader](https://github.com/webpack-contrib/thread-loader) is enabled by default when the machine has more than 1 CPU cores. This can be turned off by setting `parallel: false` in `vue.config.js`.
2626

27+
`parallel` should be set to `false` when using Typescript in combination with non-serializable loader options, such as regexes, dates and functions. These options would not be passed correctly to `ts-loader` which may lead to unexpected errors.
28+
2729
## Installing in an Already Created Project
2830

2931
``` sh

0 commit comments

Comments
 (0)