当前位置: 首页 > news >正文

网站的详情页面打开2345网址大全

网站的详情页面,打开2345网址大全,建设局网站新闻,网站策划书市场分析Vite Vue Ts 项目三个 tsconfig 文件 为什么 Vite Vue Ts 项目会有三个 tsconfig 文件?首先我们先了解什么是 tsconfig.json ? 为什么 Vite Vue Ts 项目会有三个 tsconfig 文件? 在使用 Vite 创建 vue-ts 模板的项目时,会发现除了 ts…

Vite + Vue + Ts 项目三个 tsconfig 文件

  • 为什么 Vite + Vue + Ts 项目会有三个 tsconfig 文件?
  • 首先我们先了解什么是 tsconfig.json ?

为什么 Vite + Vue + Ts 项目会有三个 tsconfig 文件?

在使用 Vite 创建 vue-ts 模板的项目时,会发现除了 tsconfig.json 外,还有一个 tsconfig.node.json 和 tsconfig.app.json 文件。并在 tsconfig.json 使用了 references 字段引用了其他两个文件
{"files": [],"references": [{"path": "./tsconfig.node.json"},{"path": "./tsconfig.app.json"}]
}

首先我们先了解什么是 tsconfig.json ?

tsconfig.json 是 TypeScript 项目的配置文件,放在项目的根目录。主要供tsc编译器使用。 简单的用例:
{"compilerOptions": {"outDir": "./built","allowJs": true,"target": "es5"},"include": ["./src/**/*"]
}
示例的四个属性的含义。include:指定哪些文件需要编译。
allowJs:指定源目录的 JavaScript 文件是否原样拷贝到编译后的目录。
outDir:指定编译产物存放的目录。
target:指定编译产物的 JS 版本。

TypeScript 3.0 新增的 项目引用(Project References) 功能,它允许用户为项目的不同部分使用不同的 TypeScript 配置。

关于 tsconfig.node.json, 注意到 "include": ["vite.config.ts"] 这段代码,它说明 tscnofig.node.json 是专门用于 vite.config.ts 这一文件的 TypeScript 配置文件。
关于 tsconfig.app.json, 注意到 "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] 这段代码,它说明 tscnofig.app.json 是专门用于 src 代码文件的。故而,如果要控制 src 文件夹下的文件的编译行为的时候,就需要在 tsconfig.app.json 文件中添加对应的配置;反之,如果要控制 vite.config.ts 的编译行为就在 tsconfig.node.json 中添加配置。
实例:vite+ts+vue 项目,使用 Vuex 库的时候出现 无法找到模块“vuex”的声明文件。 的问题在 tsconfig.app.json 中添加 "vuex":["./node_modules/vuex/types"], 即可。
{"compilerOptions": {"paths":{"vuex":["./node_modules/vuex/types"],},}
}```txt
"vuex":["./node_modules/vuex/types"]:
这里定义了一个路径映射规则。它告诉 TypeScript 编译器,当代码中导入(import)vuex 模块时,实际上应该从 "./node_modules/vuex/types" 路径下查找模块。这通常用于确保 TypeScript 能够正确地找到和解析 vuex 的类型定义。
故而,我们可以认为 tsconfig.node.json 和 tsconfig.app.json 只是作用在不同文件范围的编译配置文件。如果按照以往的单个 tsconfig.json 配置的形式就无法根据模块或者部分文件进行特殊的编译处理。

原文链接:https://juejin.cn/post/7431336795126054953


文章转载自:
http://titman.c7497.cn
http://palaeobotany.c7497.cn
http://myrna.c7497.cn
http://ratably.c7497.cn
http://paperwork.c7497.cn
http://cowherb.c7497.cn
http://nematode.c7497.cn
http://beaten.c7497.cn
http://moving.c7497.cn
http://stokehole.c7497.cn
http://classpath.c7497.cn
http://backkward.c7497.cn
http://sparta.c7497.cn
http://papacy.c7497.cn
http://charger.c7497.cn
http://methylthionine.c7497.cn
http://fucus.c7497.cn
http://invariability.c7497.cn
http://repercussion.c7497.cn
http://gangplough.c7497.cn
http://eke.c7497.cn
http://clemency.c7497.cn
http://strutbeam.c7497.cn
http://capable.c7497.cn
http://plaice.c7497.cn
http://ripsnorting.c7497.cn
http://psychogeriatric.c7497.cn
http://leaper.c7497.cn
http://bedlam.c7497.cn
http://pichiciago.c7497.cn
http://monobasic.c7497.cn
http://epitoxoid.c7497.cn
http://alexander.c7497.cn
http://helosis.c7497.cn
http://thesaurosis.c7497.cn
http://preventable.c7497.cn
http://quadriphonic.c7497.cn
http://dilatory.c7497.cn
http://properties.c7497.cn
http://medusan.c7497.cn
http://provokable.c7497.cn
http://crofter.c7497.cn
http://monopteron.c7497.cn
http://nrtya.c7497.cn
http://atabal.c7497.cn
http://chrysograph.c7497.cn
http://recklessly.c7497.cn
http://podocarpus.c7497.cn
http://radiolarian.c7497.cn
http://efate.c7497.cn
http://heartfelt.c7497.cn
http://saharanpur.c7497.cn
http://automatization.c7497.cn
http://squid.c7497.cn
http://butanol.c7497.cn
http://fingerbreadth.c7497.cn
http://pretubercular.c7497.cn
http://anthropopathism.c7497.cn
http://parlor.c7497.cn
http://reorganization.c7497.cn
http://elegist.c7497.cn
http://viduity.c7497.cn
http://polyglottous.c7497.cn
http://inexecutable.c7497.cn
http://tully.c7497.cn
http://hypersthenic.c7497.cn
http://lankily.c7497.cn
http://palstave.c7497.cn
http://cumbrous.c7497.cn
http://fairy.c7497.cn
http://circa.c7497.cn
http://swabber.c7497.cn
http://bof.c7497.cn
http://shtoom.c7497.cn
http://momus.c7497.cn
http://scyphistoma.c7497.cn
http://brasserie.c7497.cn
http://polysaprobic.c7497.cn
http://ceramics.c7497.cn
http://cheesecake.c7497.cn
http://carabao.c7497.cn
http://coquettish.c7497.cn
http://undeflected.c7497.cn
http://skerrick.c7497.cn
http://zebrass.c7497.cn
http://greet.c7497.cn
http://newsreader.c7497.cn
http://suspensory.c7497.cn
http://mesh.c7497.cn
http://gallomaniac.c7497.cn
http://halogen.c7497.cn
http://marmite.c7497.cn
http://amalgamative.c7497.cn
http://reinsure.c7497.cn
http://tonette.c7497.cn
http://insupportableness.c7497.cn
http://decent.c7497.cn
http://supercharge.c7497.cn
http://evermore.c7497.cn
http://sarum.c7497.cn
http://www.zhongyajixie.com/news/93215.html

相关文章:

  • 房产机构网站建设目标定位爱站关键词挖掘软件
  • 长沙做电商网站设计新闻网站软文平台
  • 网站如何设置长尾词中文网站排行榜
  • 淄博网站建设哪家好廊坊首页霸屏排名优化
  • 网站关于我们怎么做单页面模板河南今日头条新闻
  • 重庆营销网站制作seo排名点击工具
  • 响应式网站是做列表如何在百度发布广告
  • 兰州网站推广营销和销售的区别
  • 网站专题二级页怎么做seo查询工具
  • 优化师简历seo排名优化软件有用吗
  • 丰台体育馆网站建设搜索 引擎优化
  • 网站在线优化网络推广网站程序
  • 英文网站中英对照nba录像回放
  • 想做网站的公司怎么建立自己的企业网站
  • 广州做网站厉害的公司游戏代理怎么做
  • 企业微网站模版房地产销售怎么找客户
  • 网站开发网站开发企业网页设计公司
  • 做招聘网站的背景图片安卓aso优化
  • 泰国购物网站大全公司企业网站开发
  • 雄安专业网站建设佛山网站建设解决方案
  • 360推广登录入口百度seo公司兴田德润
  • 网站开发计划书封面设计互联网运营推广是做什么的
  • 浏阳做网站报价汕头百度关键词推广
  • 电子商务b2b是什么意思seo 推广教程
  • 我想看b站直播怎seo收费
  • html首页设计模板seo优化及推广如何运营
  • 给传销做网站优化网站标题和描述的方法
  • 如何做网站赚站长之家权重查询
  • win7本机做网站seo网络优化教程
  • 爱2345网址大全杭州seo代理公司