html文件中引入.ts文件并运行

问题: 一个项目,是用TypeScript编写的,但是html中引入了.ts文件后报错了,有没有办法跳过tsc这个编译命令,不然每次都需要Tsc编译一下后再启动,有点麻烦

html 复制代码
<!doctype html>
<html lang="zh-CN">

<head>
    <title></title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon" href="./resource/images/favicon.ico" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <!-- 这种使用方法 -->
    <script src="demo.ts"></script>
</head>
<body>
    <div id="app">
        <div class="demo1">测试</div>
    </div>
</body>
<html>
</html>
</html>
复制代码
npm install parcel@next

安装成功之后,在package.json中配置一个启动命令,比如

 "scripts": {
	"start":"parcel ./src/index.html"
 }
相关推荐
JustHappy2 小时前
古法编程秘籍(七):互联网到底是什么?把两台电脑怎么说话搞懂就够了
前端·后端·网络协议
老毛肚2 小时前
jeecg-boot-base-core 02 day
javascript·python
snow@li2 小时前
SEO-文章标题:写文章时候,分类+主标题+大纲+解释 作为标题 / 不点进去也知道全文覆盖什么 / 标题即架构
前端
kyriewen3 小时前
Git Commit 前自动修复代码风格?配置 Husky + lint-staged,从此 CR 只聊逻辑
前端·git·面试
小和尚同志4 小时前
AI 自动化测试探索(一):Playwright MCP
前端·人工智能·aigc
老马识途2.04 小时前
在AI的帮助下理解spring的启动过程
java·前端·spring
徐小夕4 小时前
Loop Engineering 深度解析与实战指南(全网最全)
前端·算法·github
运筹vivo@5 小时前
Python ContextVar 底层机制与内存模型拆解
前端·数据库·python
#麻辣小龙虾#6 小时前
基于vue3.0开发一款【固废与废气运维管理系统】(支持源码)
前端·vue.js·vue3
Cosolar6 小时前
Docsify零构建文档站完全指南:从快速搭建到企业级部署
前端·开源·github