parcel-bundler/parcel
GitHub ã§èŠãCompile to js doesn't modify script type=application/ts to type=application/javascript
Open
#2,267 opened on 2018幎11æ9æ¥
:bug: Bug:heavy_check_mark: Confirmed BugGood First Issue
Repository metrics
- Stars
- Â (44,030 stars)
- PR merge metrics
-  (30d ã« merged PR ã¯ãããŸãã)
説æ
ð bug report
Out of the box, the compilation to js of some ... works but in the resulting html the type attribute is kept intact (application/ts) and the browser (firefox in my case) doesn't execute the produced javascript
ð Configuration (.babelrc, package.json, cli command)
yarn global add parcel-bundler
yarn init -y
{
"name": "compile-to-js",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"devDependencies": {
"typescript": "^3.1.6"
}
}
ð€ Expected Behavior
The produced html should contain type="application/javascript"
ð¯ Current Behavior
The produced html contains type="application/ts"
ð» Code Sample
index.html:
<!doctype html>
<html>
<body>
<script type="application/ts">
type TT = "bouh" | "bar"
function log(t: TT){
console.log(t)
}
log("bouh")
</script>
</body>
</html>
parcel index.html
Result:
<!doctype html>
<html>
<body>
<script type="application/ts">function log(t) {
console.log(t);
}
log("bouh");</script>
</body>
</html>
ð Your Environment
| Software | Version(s) |
|---|---|
| Parcel | 1.10.3 |
| Node | v11.1.0 |
| npm/Yarn | 6.4.1/1.9.4 |
| Operating System | OSX |