From bb88fcc724731df958a2e6da1545213b3b90c00f Mon Sep 17 00:00:00 2001 From: Robbin Baauw Date: Tue, 11 Aug 2020 21:21:10 +0200 Subject: [PATCH] docs: add thread-loader warnings --- docs/config/README.md | 4 ++++ docs/core-plugins/babel.md | 2 ++ docs/core-plugins/typescript.md | 2 ++ packages/@vue/cli-plugin-babel/README.md | 2 ++ packages/@vue/cli-plugin-typescript/README.md | 2 ++ 5 files changed, 12 insertions(+) diff --git a/docs/config/README.md b/docs/config/README.md index 5245eeea3e..71ea34fea1 100644 --- a/docs/config/README.md +++ b/docs/config/README.md @@ -380,6 +380,10 @@ In v3 this means the opposite of `css.requireModuleExtension`. 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. +::: warning +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. +::: + ### pwa - Type: `Object` diff --git a/docs/core-plugins/babel.md b/docs/core-plugins/babel.md index 278d077509..d5b5742f8a 100644 --- a/docs/core-plugins/babel.md +++ b/docs/core-plugins/babel.md @@ -26,6 +26,8 @@ module.exports = { [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`. +`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. + ## Installing in an Already Created Project ``` sh diff --git a/docs/core-plugins/typescript.md b/docs/core-plugins/typescript.md index 7a588a55a8..c466d2f537 100644 --- a/docs/core-plugins/typescript.md +++ b/docs/core-plugins/typescript.md @@ -24,6 +24,8 @@ If opted to use [TSLint](https://palantir.github.io/tslint/) during project crea [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`. +`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. + ## Installing in an Already Created Project ``` sh diff --git a/packages/@vue/cli-plugin-babel/README.md b/packages/@vue/cli-plugin-babel/README.md index 278d077509..d5b5742f8a 100644 --- a/packages/@vue/cli-plugin-babel/README.md +++ b/packages/@vue/cli-plugin-babel/README.md @@ -26,6 +26,8 @@ module.exports = { [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`. +`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. + ## Installing in an Already Created Project ``` sh diff --git a/packages/@vue/cli-plugin-typescript/README.md b/packages/@vue/cli-plugin-typescript/README.md index 7a588a55a8..c466d2f537 100644 --- a/packages/@vue/cli-plugin-typescript/README.md +++ b/packages/@vue/cli-plugin-typescript/README.md @@ -24,6 +24,8 @@ If opted to use [TSLint](https://palantir.github.io/tslint/) during project crea [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`. +`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. + ## Installing in an Already Created Project ``` sh