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

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

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"
 }

你可能感兴趣的:(javascript,前端)