Changing compilerOptions directives in vue.config.js not working in 2.7 when building

This issue has been created since 2022-10-14.

Version

2.7.12

Reproduction link

github.com

Steps to reproduce

  1. Clone the minimal reproduction repo and do npm run build. The code in vue.config.js: https://github.com/tunnelpuzzle/vue-compiler-directive/blob/master/vue.config.js#L11-L12 for the v-show directive won't be run.

  2. Switch to Vue 2.6 npm i [email protected] [email protected] and then do npm run build. The code to for the v-show directive is run.

What is expected?

Changing the compilerOptions directives should work in Vue 2.7 when building.

What is actually happening?

Changing the compilerOptions directives when building works in Vue 2.6 but not Vue 2.7


I looked in the release notes but couldn't find anything about this behavior changing in 2.7.

yyx990803 wrote this answer on 2022-10-15

/cc @sodatea this seems to be related to thread-loader not able to pass options that contain functions to worker thread (only in build).

Not sure why this behavior is different between 2.6 and 2.7. Is there some logic in vue-cli that enables/disables thread-loader on vue-loader?

For now you can work around this by setting parallel: false in vue.config.js.

sodatea wrote this answer on 2022-10-15

Not sure why this behavior is different between 2.6 and 2.7. Is there some logic in vue-cli that enables/disables thread-loader on vue-loader?

It's in vue-loader.
Vue 2.7+ also applies js loaders to compiled <template> code, and among them is thread-loader.
Vue 2.6 template compilation doesn't go through js loaders, thus no problem.

sodatea wrote this answer on 2022-10-15

This issue could be mostly mitigated if we detect and skip cloning thread-loader rules in VueLoaderPlugin

sodatea wrote this answer on 2022-11-14
More Details About Repo
Owner Name vuejs
Repo Name vue
Full Name vuejs/vue
Language TypeScript
Created Date 2013-07-29
Updated Date 2022-12-10
Star Count 201155
Watcher Count 6070
Fork Count 33134
Issue Count 595

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
Where is the benchmark about 90 times faster than HF transformers? 11 2022-04-09 2022-09-07
prevent shared dependencies from generating 0 2022-11-24 2022-12-07
React Webpack Host -> React Vite Remote 0 2022-11-21 2022-12-07
vite shared 的 vue 不是同一个对象Container initialization failed as it has already been initialized with a different share scope 0 2022-11-23 2022-12-07
React TypeError: Cannot read properties of null (reading 'useState') 0 2022-11-29 2022-12-07
do not remove zone tile if a building is placed on a zone 0 2022-03-23 2022-08-20
XDP hook point not getting triggered 2 2022-04-29 2022-10-31
Add check for required calm-notifications before running any further. 0 2021-11-19 2022-10-22
weechat libera chat needs to be setup 0 2021-11-16 2022-10-20
I can't run the script, claim and get commands 1 2022-06-10 2022-07-14
[REQ] - Refresh Metadata in Plex 4 2021-03-23 2022-10-27
Can't open program on Windows 10 64bit 5 2021-06-11 2022-08-09
ModuleNotFoundError: No module named 'colorama' 7 2022-01-30 2022-10-27
[Proposal] Add the ability to optionally provide an implicit conversion operator between the wrapper type and the primitive type 9 2021-09-03 2022-11-06
Security Policy violation Binary Artifacts 1 2022-06-01 2022-11-22
Deprecation warnings in UUIDNavType (Serializable / Parcelable) 4 2022-10-24 2022-11-23
Simple combo does not work with empty data source 0 2022-11-07 2022-11-12
tokenize with Spacy 2 2020-07-30 2022-01-19
Autoripper should only select ONE Track 11 2022-06-14 2022-12-02
[BUG] Internal player and MPV video stutters, VLC plays fine 1 2022-08-30 2022-11-21
element groups are still broken in stripmining 8 2022-07-16 2022-11-25
Null-coalescing assignment operator ??= refactoring changes semantics if equality overloads exist 8 2021-10-14 2022-11-22
Trigger workflow run when plugin's repo changes 0 2021-04-18 2022-11-30
Nextjs example 3 2017-07-03 2022-01-11
V1: Porting to based sdk v0.43.0 and v0.44.0 for vega upgrade 0 2021-07-29 2022-11-20
Feature Request: Import architecture breaks into SonarQube 4 2021-12-26 2022-10-11
Incorrect indent guides with treesitter enabled 1 2021-09-22 2022-10-23
Internal Server Error with URL over 8k 4 2021-09-15 2022-12-03
Questions: does Winds have a limit on the age of unread items? 2 2019-05-23 2022-11-22
Code example request: form loading with value returned from API request 0 2021-09-08 2022-09-17
alluxio on ceph,delete files,but the files still exists on ceph 1 2021-10-21 2022-10-29
Actor EditorActorComponent.cpp could use a refactor organizing with Controller and Config classes 1 2022-06-04 2022-10-22
hv/requests.h duplicate definition 0 2021-05-30 2022-11-13
ci: the ci_crio_entry_point.sh script fails 1 2021-10-18 2022-10-14
Create Windows feature release plan 0 2022-08-11 2022-08-31
Configure hybrid-OS option for bookstore demo script 0 2022-08-11 2022-08-31
[Bug] httpApi events should not add CORS headers for endpoints unless explicitly defined 0 2021-04-14 2022-11-23
Pattern type for structured data files (yaml, json...) 33 2022-01-18 2022-11-26
On the 4.20.1 version of docs inside of the React integration Guide first tab is always highlighted 0 2022-11-24 2022-12-05
mosquitto-auth-plug make error 2 2021-08-30 2022-11-09
Not able to see latest messages on kowl? 21 2021-09-27 2022-11-27
no error when setting `init=False` on `Final` field in dataclass 6 2022-07-14 2022-11-08
The constructor `DataType::Decimal(usize, usize)` is unsound. 14 2022-08-08 2022-10-03
Sane support for native markdown comments via footnote like-syntax 2 2021-12-18 2022-12-06
PiHole instructions fail 7 2021-12-05 2022-08-13
[BUG] Firefox crashes with "tab crash" after upgrade to Ubuntu 22.04 4 2022-06-20 2022-10-14
micro_ros_setup build `android generic` falied 0 2022-07-28 2022-11-11
Advice - How to filter 4 2021-05-31 2022-12-04
[Self-Managed]: Add fleet server flyout not closed on clicking Fleet settings after generating policy. 3 2022-11-10 2022-11-05
Versions of vue-loader 16.6.0+ issues compile time error while using with vue-svg-loader 4 2021-09-24 2022-12-08