Vue3+ts packaging error handling

The package reports an error
insert image description herebut npm run dev is running normally
After some searching, this error is more difficult to find

Pay attention to vue-tsc --noEmit in package.json and delete it

insert image description here
{
“name”: “vuevitec”,
“version”: “0.0.0”,
“scripts”: {
“dev”: “vite”,
“build”: “vue-tsc --noEmit && vite build”,
“preview”: “vite preview”
},
改成如下
insert image description here

{
“name”: “vuevitec”,
“version”: “0.0.0”,
“scripts”: {
“dev”: “vite”,
“build”: “vite build”,
“preview”: “vite preview”
},

Search what vue-tsc --noEmit does
Execute tsc --noEmit, TSC will read the configuration file to obtain parameter values, the function of --noEmit is to only check, not to compile and output. If our code is error-free, it will exit directly, otherwise it will report an error.

Guess you like

Origin blog.csdn.net/weixin_42021688/article/details/128206358