Skip to content

Commit

Permalink
Recreate vite bundler sample with TypeScript (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasamonrc authored Sep 26, 2024
1 parent a2365c4 commit 26f0a27
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 34 deletions.
25 changes: 24 additions & 1 deletion ui-web/samples/bundlers/vite/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
dist/
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
23 changes: 12 additions & 11 deletions ui-web/samples/bundlers/vite/index.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<!-- Include your main JavaScript file -->
<script type="module" src="/main.js"></script>
</body>
</html>
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + TS</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
34 changes: 24 additions & 10 deletions ui-web/samples/bundlers/vite/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions ui-web/samples/bundlers/vite/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "@trinsic/web-ui-vite-sample",
"version": "1.0.0",
"main": "index.js",
"name": "vite",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"build": "vite build",
"start": "vite"
},
"author": "",
"license": "MIT",
"description": "",
"dependencies": {
"@trinsic/web-ui": "^1.2.8-alpha3"
"start": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"devDependencies": {
"vite": "^5.4.8"
"typescript": "^5.5.3",
"vite": "^5.4.1"
},
"dependencies": {
"@trinsic/web-ui": "^1.2.10"
}
}
File renamed without changes.
1 change: 1 addition & 0 deletions ui-web/samples/bundlers/vite/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
23 changes: 23 additions & 0 deletions ui-web/samples/bundlers/vite/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"]
}

0 comments on commit 26f0a27

Please sign in to comment.