-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(template): add vanilla typescript (#130)
* add vanilla typescript template * sort imports Co-authored-by: Danilo Woznica <[email protected]>
- Loading branch information
1 parent
fdebafd
commit d33eeb9
Showing
4 changed files
with
84 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import type { SandboxTemplate } from "../types"; | ||
|
||
export const VANILLA_TYPESCRIPT_TEMPLATE: SandboxTemplate = { | ||
files: { | ||
"tsconfig.json": { | ||
code: `{ | ||
"compilerOptions": { | ||
"strict": true, | ||
"module": "commonjs", | ||
"jsx": "preserve", | ||
"esModuleInterop": true, | ||
"sourceMap": true, | ||
"allowJs": true, | ||
"lib": [ | ||
"es6", | ||
"dom" | ||
], | ||
"rootDir": "src", | ||
"moduleResolution": "node" | ||
} | ||
}`, | ||
}, | ||
"/src/index.ts": { | ||
code: `import "./styles.css"; | ||
document.getElementById("app").innerHTML = \` | ||
<h1>Hello Vanilla!</h1> | ||
<div> | ||
We use the same configuration as Parcel to bundle this sandbox, you can find more | ||
info about Parcel | ||
<a href="https://parceljs.org" target="_blank" rel="noopener noreferrer">here</a>. | ||
</div> | ||
\`; | ||
`, | ||
}, | ||
"/src/styles.css": { | ||
code: `body { | ||
font-family: sans-serif; | ||
} | ||
`, | ||
}, | ||
"/index.html": { | ||
code: `<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Parcel Sandbox</title> | ||
<meta charset="UTF-8" /> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script src="src/index.ts"> | ||
</script> | ||
</body> | ||
</html>`, | ||
}, | ||
}, | ||
dependencies: {}, | ||
devDependencies: { | ||
typescript: "^4.0.0", | ||
}, | ||
entry: "/src/index.ts", | ||
main: "/src/index.ts", | ||
environment: "parcel", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d33eeb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: