create-vite-extra 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/index.js +26 -3
  2. package/package.json +1 -1
  3. package/template-deno-lit/README.md +30 -0
  4. package/template-deno-lit/deno.json +8 -0
  5. package/template-deno-lit/index.html +16 -0
  6. package/template-deno-lit/public/vite.svg +1 -0
  7. package/template-deno-lit/src/assets/lit.svg +1 -0
  8. package/template-deno-lit/src/index.css +31 -0
  9. package/template-deno-lit/src/my-element.js +129 -0
  10. package/template-deno-lit/vite.config.mjs +16 -0
  11. package/template-deno-preact/README.md +30 -0
  12. package/template-deno-preact/deno.json +8 -0
  13. package/template-deno-preact/index.html +13 -0
  14. package/template-deno-preact/public/vite.svg +1 -0
  15. package/template-deno-preact/src/app.css +25 -0
  16. package/template-deno-preact/src/app.jsx +32 -0
  17. package/template-deno-preact/src/assets/preact.svg +1 -0
  18. package/template-deno-preact/src/index.css +70 -0
  19. package/template-deno-preact/src/main.jsx +5 -0
  20. package/template-deno-preact/vite.config.mjs +10 -0
  21. package/template-deno-react/README.md +30 -0
  22. package/template-deno-react/deno.json +8 -0
  23. package/template-deno-react/index.html +13 -0
  24. package/template-deno-react/public/vite.svg +1 -0
  25. package/template-deno-react/src/App.css +41 -0
  26. package/template-deno-react/src/App.jsx +34 -0
  27. package/template-deno-react/src/assets/react.svg +1 -0
  28. package/template-deno-react/src/index.css +70 -0
  29. package/template-deno-react/src/main.jsx +10 -0
  30. package/template-deno-react/vite.config.mjs +10 -0
  31. package/template-deno-svelte/.vscode/extensions.json +3 -0
  32. package/template-deno-svelte/README.md +30 -0
  33. package/template-deno-svelte/deno.json +8 -0
  34. package/template-deno-svelte/index.html +13 -0
  35. package/template-deno-svelte/jsconfig.json +34 -0
  36. package/template-deno-svelte/public/vite.svg +1 -0
  37. package/template-deno-svelte/src/App.svelte +45 -0
  38. package/template-deno-svelte/src/app.css +81 -0
  39. package/template-deno-svelte/src/assets/svelte.svg +1 -0
  40. package/template-deno-svelte/src/lib/Counter.svelte +10 -0
  41. package/template-deno-svelte/src/main.js +8 -0
  42. package/template-deno-svelte/src/vite-env.d.ts +2 -0
  43. package/template-deno-svelte/vite.config.mjs +9 -0
  44. package/template-deno-vanilla/counter.js +9 -0
  45. package/template-deno-vanilla/deno.json +8 -0
  46. package/template-deno-vanilla/index.html +13 -0
  47. package/template-deno-vanilla/javascript.svg +1 -0
  48. package/template-deno-vanilla/main.js +23 -0
  49. package/template-deno-vanilla/public/vite.svg +1 -0
  50. package/template-deno-vanilla/style.css +97 -0
  51. package/template-deno-vue/README.md +11 -22
package/index.js CHANGED
@@ -105,9 +105,29 @@ const FRAMEWORKS = [
105
105
  ]
106
106
  },
107
107
  {
108
- name: 'ssr-transform',
108
+ name: 'deno-vanilla',
109
+ color: yellow
110
+ },
111
+ {
112
+ name: 'deno-vue',
113
+ color: green
114
+ },
115
+ {
116
+ name: 'deno-react',
117
+ color: cyan
118
+ },
119
+ {
120
+ name: 'deno-preact',
121
+ color: magenta
122
+ },
123
+ {
124
+ name: 'deno-lit',
109
125
  color: lightRed
110
126
  },
127
+ {
128
+ name: 'deno-svelte',
129
+ color: red
130
+ },
111
131
  {
112
132
  name: 'library',
113
133
  color: lightMagenta,
@@ -125,8 +145,8 @@ const FRAMEWORKS = [
125
145
  ]
126
146
  },
127
147
  {
128
- name: 'deno-vue',
129
- color: green
148
+ name: 'ssr-transform',
149
+ color: lightRed
130
150
  }
131
151
  ]
132
152
 
@@ -139,6 +159,8 @@ const renameFiles = {
139
159
  }
140
160
 
141
161
  async function init() {
162
+ /** @type {string} */
163
+ // @ts-ignore
142
164
  let targetDir = formatTargetDir(argv._[0])
143
165
  let template = argv.template || argv.t
144
166
 
@@ -171,6 +193,7 @@ async function init() {
171
193
  ` is not empty. Remove existing files and continue?`
172
194
  },
173
195
  {
196
+ // @ts-ignore
174
197
  type: (_, { overwrite } = {}) => {
175
198
  if (overwrite === false) {
176
199
  throw new Error(red('✖') + ' Operation cancelled')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-vite-extra",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Bjorn Lu",
@@ -0,0 +1,30 @@
1
+ # Vite + Vue + Lit
2
+
3
+ ## Running
4
+
5
+ You need to have Deno v1.25.4 or later intalled to run this repo.
6
+
7
+ Start a dev server:
8
+
9
+ ```
10
+ $ deno task dev
11
+ ```
12
+
13
+ ## Deploy
14
+
15
+ Build production assets:
16
+
17
+ ```
18
+ $ deno task build
19
+ ```
20
+
21
+ ## Notes
22
+
23
+ - You need to use `.mjs` or `.mts` extension for the `vite.config.[ext]` file.
24
+
25
+ ## Papercuts
26
+
27
+ Currently there's a "papercut" for Deno users:
28
+
29
+ - peer dependencies need to be referenced in `vite.config.js` - in this example
30
+ it is `lit` package that needs to be referenced
@@ -0,0 +1,8 @@
1
+ {
2
+ "tasks": {
3
+ "dev": "deno run -A --unstable --node-modules-dir npm:vite",
4
+ "build": "deno run -A --unstable --node-modules-dir npm:vite build",
5
+ "preview": "deno run -A --unstable --node-modules-dir npm:vite preview",
6
+ "serve": "deno run --allow-net --allow-read main.ts"
7
+ }
8
+ }
@@ -0,0 +1,16 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Vite + Lit</title>
8
+ <link rel="stylesheet" href="./src/index.css" />
9
+ <script type="module" src="/src/my-element.js"></script>
10
+ </head>
11
+ <body>
12
+ <my-element>
13
+ <h1>Vite + Lit</h1>
14
+ </my-element>
15
+ </body>
16
+ </html>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="25.6" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 320"><path fill="#00E8FF" d="m64 192l25.926-44.727l38.233-19.114l63.974 63.974l10.833 61.754L192 320l-64-64l-38.074-25.615z"></path><path fill="#283198" d="M128 256V128l64-64v128l-64 64ZM0 256l64 64l9.202-60.602L64 192l-37.542 23.71L0 256Z"></path><path fill="#324FFF" d="M64 192V64l64-64v128l-64 64Zm128 128V192l64-64v128l-64 64ZM0 256V128l64 64l-64 64Z"></path><path fill="#0FF" d="M64 320V192l64 64z"></path></svg>
@@ -0,0 +1,31 @@
1
+ :root {
2
+ font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
3
+ font-size: 16px;
4
+ line-height: 24px;
5
+ font-weight: 400;
6
+
7
+ color-scheme: light dark;
8
+ color: rgba(255, 255, 255, 0.87);
9
+ background-color: #242424;
10
+
11
+ font-synthesis: none;
12
+ text-rendering: optimizeLegibility;
13
+ -webkit-font-smoothing: antialiased;
14
+ -moz-osx-font-smoothing: grayscale;
15
+ -webkit-text-size-adjust: 100%;
16
+ }
17
+
18
+ body {
19
+ margin: 0;
20
+ display: flex;
21
+ place-items: center;
22
+ min-width: 320px;
23
+ min-height: 100vh;
24
+ }
25
+
26
+ @media (prefers-color-scheme: light) {
27
+ :root {
28
+ color: #213547;
29
+ background-color: #ffffff;
30
+ }
31
+ }
@@ -0,0 +1,129 @@
1
+ import { LitElement, css, html } from 'lit'
2
+ import litLogo from './assets/lit.svg'
3
+
4
+ /**
5
+ * An example element.
6
+ *
7
+ * @slot - This element has a slot
8
+ * @csspart button - The button
9
+ */
10
+ export class MyElement extends LitElement {
11
+ static get properties() {
12
+ return {
13
+ /**
14
+ * Copy for the read the docs hint.
15
+ */
16
+ docsHint: { type: String },
17
+
18
+ /**
19
+ * The number of times the button has been clicked.
20
+ */
21
+ count: { type: Number }
22
+ }
23
+ }
24
+
25
+ constructor() {
26
+ super()
27
+ this.docsHint = 'Click on the Vite and Lit logos to learn more'
28
+ this.count = 0
29
+ }
30
+
31
+ render() {
32
+ return html`
33
+ <div>
34
+ <a href="https://vitejs.dev" target="_blank">
35
+ <img src="/vite.svg" class="logo" alt="Vite logo" />
36
+ </a>
37
+ <a href="https://lit.dev" target="_blank">
38
+ <img src=${litLogo} class="logo lit" alt="Lit logo" />
39
+ </a>
40
+ </div>
41
+ <slot></slot>
42
+ <div class="card">
43
+ <button @click=${this._onClick} part="button">
44
+ count is ${this.count}
45
+ </button>
46
+ </div>
47
+ <p class="read-the-docs">${this.docsHint}</p>
48
+ `
49
+ }
50
+
51
+ _onClick() {
52
+ this.count++
53
+ }
54
+
55
+ static get styles() {
56
+ return css`
57
+ :host {
58
+ max-width: 1280px;
59
+ margin: 0 auto;
60
+ padding: 2rem;
61
+ text-align: center;
62
+ }
63
+
64
+ .logo {
65
+ height: 6em;
66
+ padding: 1.5em;
67
+ will-change: filter;
68
+ }
69
+ .logo:hover {
70
+ filter: drop-shadow(0 0 2em #646cffaa);
71
+ }
72
+ .logo.lit:hover {
73
+ filter: drop-shadow(0 0 2em #325cffaa);
74
+ }
75
+
76
+ .card {
77
+ padding: 2em;
78
+ }
79
+
80
+ .read-the-docs {
81
+ color: #888;
82
+ }
83
+
84
+ a {
85
+ font-weight: 500;
86
+ color: #646cff;
87
+ text-decoration: inherit;
88
+ }
89
+ a:hover {
90
+ color: #535bf2;
91
+ }
92
+
93
+ h1 {
94
+ font-size: 3.2em;
95
+ line-height: 1.1;
96
+ }
97
+
98
+ button {
99
+ border-radius: 8px;
100
+ border: 1px solid transparent;
101
+ padding: 0.6em 1.2em;
102
+ font-size: 1em;
103
+ font-weight: 500;
104
+ font-family: inherit;
105
+ background-color: #1a1a1a;
106
+ cursor: pointer;
107
+ transition: border-color 0.25s;
108
+ }
109
+ button:hover {
110
+ border-color: #646cff;
111
+ }
112
+ button:focus,
113
+ button:focus-visible {
114
+ outline: 4px auto -webkit-focus-ring-color;
115
+ }
116
+
117
+ @media (prefers-color-scheme: light) {
118
+ a:hover {
119
+ color: #747bff;
120
+ }
121
+ button {
122
+ background-color: #f9f9f9;
123
+ }
124
+ }
125
+ `
126
+ }
127
+ }
128
+
129
+ window.customElements.define('my-element', MyElement)
@@ -0,0 +1,16 @@
1
+ import { defineConfig } from 'npm:vite'
2
+
3
+ import "npm:lit";
4
+
5
+ // https://vitejs.dev/config/
6
+ export default defineConfig({
7
+ build: {
8
+ lib: {
9
+ entry: 'src/my-element.js',
10
+ formats: ['es']
11
+ },
12
+ rollupOptions: {
13
+ external: /^lit/
14
+ }
15
+ }
16
+ })
@@ -0,0 +1,30 @@
1
+ # Vite + Vue + Preact
2
+
3
+ ## Running
4
+
5
+ You need to have Deno v1.25.4 or later intalled to run this repo.
6
+
7
+ Start a dev server:
8
+
9
+ ```
10
+ $ deno task dev
11
+ ```
12
+
13
+ ## Deploy
14
+
15
+ Build production assets:
16
+
17
+ ```
18
+ $ deno task build
19
+ ```
20
+
21
+ ## Notes
22
+
23
+ - You need to use `.mjs` or `.mts` extension for the `vite.config.[ext]` file.
24
+
25
+ ## Papercuts
26
+
27
+ Currently there's a "papercut" for Deno users:
28
+
29
+ - peer dependencies need to be referenced in `vite.config.js` - in this example
30
+ it is `preact` and `preact/hooks` packages that need to be referenced
@@ -0,0 +1,8 @@
1
+ {
2
+ "tasks": {
3
+ "dev": "deno run -A --unstable --node-modules-dir npm:vite",
4
+ "build": "deno run -A --unstable --node-modules-dir npm:vite build",
5
+ "preview": "deno run -A --unstable --node-modules-dir npm:vite preview",
6
+ "serve": "deno run --allow-net --allow-read main.ts"
7
+ }
8
+ }
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Vite + Preact</title>
8
+ </head>
9
+ <body>
10
+ <div id="app"></div>
11
+ <script type="module" src="/src/main.jsx"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1,25 @@
1
+ #app {
2
+ max-width: 1280px;
3
+ margin: 0 auto;
4
+ padding: 2rem;
5
+ text-align: center;
6
+ }
7
+
8
+ .logo {
9
+ height: 6em;
10
+ padding: 1.5em;
11
+ }
12
+ .logo:hover {
13
+ filter: drop-shadow(0 0 2em #646cffaa);
14
+ }
15
+ .logo.preact:hover {
16
+ filter: drop-shadow(0 0 2em #673ab8aa);
17
+ }
18
+
19
+ .card {
20
+ padding: 2em;
21
+ }
22
+
23
+ .read-the-docs {
24
+ color: #888;
25
+ }
@@ -0,0 +1,32 @@
1
+ import { useState } from 'preact/hooks'
2
+ import preactLogo from './assets/preact.svg'
3
+ import './app.css'
4
+
5
+ export function App() {
6
+ const [count, setCount] = useState(0)
7
+
8
+ return (
9
+ <>
10
+ <div>
11
+ <a href="https://vitejs.dev" target="_blank">
12
+ <img src="/vite.svg" class="logo" alt="Vite logo" />
13
+ </a>
14
+ <a href="https://preactjs.com" target="_blank">
15
+ <img src={preactLogo} class="logo preact" alt="Preact logo" />
16
+ </a>
17
+ </div>
18
+ <h1>Vite + Preact</h1>
19
+ <div class="card">
20
+ <button onClick={() => setCount((count) => count + 1)}>
21
+ count is {count}
22
+ </button>
23
+ <p>
24
+ Edit <code>src/app.jsx</code> and save to test HMR
25
+ </p>
26
+ </div>
27
+ <p class="read-the-docs">
28
+ Click on the Vite and Preact logos to learn more
29
+ </p>
30
+ </>
31
+ )
32
+ }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="27.68" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 296"><path fill="#673AB8" d="m128 0l128 73.9v147.8l-128 73.9L0 221.7V73.9z"></path><path fill="#FFF" d="M34.865 220.478c17.016 21.78 71.095 5.185 122.15-34.704c51.055-39.888 80.24-88.345 63.224-110.126c-17.017-21.78-71.095-5.184-122.15 34.704c-51.055 39.89-80.24 88.346-63.224 110.126Zm7.27-5.68c-5.644-7.222-3.178-21.402 7.573-39.253c11.322-18.797 30.541-39.548 54.06-57.923c23.52-18.375 48.303-32.004 69.281-38.442c19.922-6.113 34.277-5.075 39.92 2.148c5.644 7.223 3.178 21.403-7.573 39.254c-11.322 18.797-30.541 39.547-54.06 57.923c-23.52 18.375-48.304 32.004-69.281 38.441c-19.922 6.114-34.277 5.076-39.92-2.147Z"></path><path fill="#FFF" d="M220.239 220.478c17.017-21.78-12.169-70.237-63.224-110.126C105.96 70.464 51.88 53.868 34.865 75.648c-17.017 21.78 12.169 70.238 63.224 110.126c51.055 39.889 105.133 56.485 122.15 34.704Zm-7.27-5.68c-5.643 7.224-19.998 8.262-39.92 2.148c-20.978-6.437-45.761-20.066-69.28-38.441c-23.52-18.376-42.74-39.126-54.06-57.923c-10.752-17.851-13.218-32.03-7.575-39.254c5.644-7.223 19.999-8.261 39.92-2.148c20.978 6.438 45.762 20.067 69.281 38.442c23.52 18.375 42.739 39.126 54.06 57.923c10.752 17.85 13.218 32.03 7.574 39.254Z"></path><path fill="#FFF" d="M127.552 167.667c10.827 0 19.603-8.777 19.603-19.604c0-10.826-8.776-19.603-19.603-19.603c-10.827 0-19.604 8.777-19.604 19.603c0 10.827 8.777 19.604 19.604 19.604Z"></path></svg>
@@ -0,0 +1,70 @@
1
+ :root {
2
+ font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
3
+ font-size: 16px;
4
+ line-height: 24px;
5
+ font-weight: 400;
6
+
7
+ color-scheme: light dark;
8
+ color: rgba(255, 255, 255, 0.87);
9
+ background-color: #242424;
10
+
11
+ font-synthesis: none;
12
+ text-rendering: optimizeLegibility;
13
+ -webkit-font-smoothing: antialiased;
14
+ -moz-osx-font-smoothing: grayscale;
15
+ -webkit-text-size-adjust: 100%;
16
+ }
17
+
18
+ a {
19
+ font-weight: 500;
20
+ color: #646cff;
21
+ text-decoration: inherit;
22
+ }
23
+ a:hover {
24
+ color: #535bf2;
25
+ }
26
+
27
+ body {
28
+ margin: 0;
29
+ display: flex;
30
+ place-items: center;
31
+ min-width: 320px;
32
+ min-height: 100vh;
33
+ }
34
+
35
+ h1 {
36
+ font-size: 3.2em;
37
+ line-height: 1.1;
38
+ }
39
+
40
+ button {
41
+ border-radius: 8px;
42
+ border: 1px solid transparent;
43
+ padding: 0.6em 1.2em;
44
+ font-size: 1em;
45
+ font-weight: 500;
46
+ font-family: inherit;
47
+ background-color: #1a1a1a;
48
+ cursor: pointer;
49
+ transition: border-color 0.25s;
50
+ }
51
+ button:hover {
52
+ border-color: #646cff;
53
+ }
54
+ button:focus,
55
+ button:focus-visible {
56
+ outline: 4px auto -webkit-focus-ring-color;
57
+ }
58
+
59
+ @media (prefers-color-scheme: light) {
60
+ :root {
61
+ color: #213547;
62
+ background-color: #ffffff;
63
+ }
64
+ a:hover {
65
+ color: #747bff;
66
+ }
67
+ button {
68
+ background-color: #f9f9f9;
69
+ }
70
+ }
@@ -0,0 +1,5 @@
1
+ import { render } from 'preact'
2
+ import { App } from './app'
3
+ import './index.css'
4
+
5
+ render(<App />, document.getElementById('app'))
@@ -0,0 +1,10 @@
1
+ import { defineConfig } from 'npm:vite'
2
+ import preact from 'npm:@preact/preset-vite'
3
+
4
+ import "npm:preact";
5
+ import "npm:preact/hooks";
6
+
7
+ // https://vitejs.dev/config/
8
+ export default defineConfig({
9
+ plugins: [preact()]
10
+ })
@@ -0,0 +1,30 @@
1
+ # Vite + Vue + React
2
+
3
+ ## Running
4
+
5
+ You need to have Deno v1.25.4 or later intalled to run this repo.
6
+
7
+ Start a dev server:
8
+
9
+ ```
10
+ $ deno task dev
11
+ ```
12
+
13
+ ## Deploy
14
+
15
+ Build production assets:
16
+
17
+ ```
18
+ $ deno task build
19
+ ```
20
+
21
+ ## Notes
22
+
23
+ - You need to use `.mjs` or `.mts` extension for the `vite.config.[ext]` file.
24
+
25
+ ## Papercuts
26
+
27
+ Currently there's a "papercut" for Deno users:
28
+
29
+ - peer dependencies need to be referenced in `vite.config.js` - in this example
30
+ it is `react` and `react-dom` packages that need to be referenced
@@ -0,0 +1,8 @@
1
+ {
2
+ "tasks": {
3
+ "dev": "deno run -A --unstable --node-modules-dir npm:vite",
4
+ "build": "deno run -A --unstable --node-modules-dir npm:vite build",
5
+ "preview": "deno run -A --unstable --node-modules-dir npm:vite preview",
6
+ "serve": "deno run --allow-net --allow-read main.ts"
7
+ }
8
+ }
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Vite + React</title>
8
+ </head>
9
+ <body>
10
+ <div id="root"></div>
11
+ <script type="module" src="/src/main.jsx"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1,41 @@
1
+ #root {
2
+ max-width: 1280px;
3
+ margin: 0 auto;
4
+ padding: 2rem;
5
+ text-align: center;
6
+ }
7
+
8
+ .logo {
9
+ height: 6em;
10
+ padding: 1.5em;
11
+ will-change: filter;
12
+ }
13
+ .logo:hover {
14
+ filter: drop-shadow(0 0 2em #646cffaa);
15
+ }
16
+ .logo.react:hover {
17
+ filter: drop-shadow(0 0 2em #61dafbaa);
18
+ }
19
+
20
+ @keyframes logo-spin {
21
+ from {
22
+ transform: rotate(0deg);
23
+ }
24
+ to {
25
+ transform: rotate(360deg);
26
+ }
27
+ }
28
+
29
+ @media (prefers-reduced-motion: no-preference) {
30
+ a:nth-of-type(2) .logo {
31
+ animation: logo-spin infinite 20s linear;
32
+ }
33
+ }
34
+
35
+ .card {
36
+ padding: 2em;
37
+ }
38
+
39
+ .read-the-docs {
40
+ color: #888;
41
+ }
@@ -0,0 +1,34 @@
1
+ import { useState } from 'react'
2
+ import reactLogo from './assets/react.svg'
3
+ import './App.css'
4
+
5
+ function App() {
6
+ const [count, setCount] = useState(0)
7
+
8
+ return (
9
+ <div className="App">
10
+ <div>
11
+ <a href="https://vitejs.dev" target="_blank">
12
+ <img src="/vite.svg" className="logo" alt="Vite logo" />
13
+ </a>
14
+ <a href="https://reactjs.org" target="_blank">
15
+ <img src={reactLogo} className="logo react" alt="React logo" />
16
+ </a>
17
+ </div>
18
+ <h1>Vite + React</h1>
19
+ <div className="card">
20
+ <button onClick={() => setCount((count) => count + 1)}>
21
+ count is {count}
22
+ </button>
23
+ <p>
24
+ Edit <code>src/App.jsx</code> and save to test HMR
25
+ </p>
26
+ </div>
27
+ <p className="read-the-docs">
28
+ Click on the Vite and React logos to learn more
29
+ </p>
30
+ </div>
31
+ )
32
+ }
33
+
34
+ export default App
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>
@@ -0,0 +1,70 @@
1
+ :root {
2
+ font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
3
+ font-size: 16px;
4
+ line-height: 24px;
5
+ font-weight: 400;
6
+
7
+ color-scheme: light dark;
8
+ color: rgba(255, 255, 255, 0.87);
9
+ background-color: #242424;
10
+
11
+ font-synthesis: none;
12
+ text-rendering: optimizeLegibility;
13
+ -webkit-font-smoothing: antialiased;
14
+ -moz-osx-font-smoothing: grayscale;
15
+ -webkit-text-size-adjust: 100%;
16
+ }
17
+
18
+ a {
19
+ font-weight: 500;
20
+ color: #646cff;
21
+ text-decoration: inherit;
22
+ }
23
+ a:hover {
24
+ color: #535bf2;
25
+ }
26
+
27
+ body {
28
+ margin: 0;
29
+ display: flex;
30
+ place-items: center;
31
+ min-width: 320px;
32
+ min-height: 100vh;
33
+ }
34
+
35
+ h1 {
36
+ font-size: 3.2em;
37
+ line-height: 1.1;
38
+ }
39
+
40
+ button {
41
+ border-radius: 8px;
42
+ border: 1px solid transparent;
43
+ padding: 0.6em 1.2em;
44
+ font-size: 1em;
45
+ font-weight: 500;
46
+ font-family: inherit;
47
+ background-color: #1a1a1a;
48
+ cursor: pointer;
49
+ transition: border-color 0.25s;
50
+ }
51
+ button:hover {
52
+ border-color: #646cff;
53
+ }
54
+ button:focus,
55
+ button:focus-visible {
56
+ outline: 4px auto -webkit-focus-ring-color;
57
+ }
58
+
59
+ @media (prefers-color-scheme: light) {
60
+ :root {
61
+ color: #213547;
62
+ background-color: #ffffff;
63
+ }
64
+ a:hover {
65
+ color: #747bff;
66
+ }
67
+ button {
68
+ background-color: #f9f9f9;
69
+ }
70
+ }
@@ -0,0 +1,10 @@
1
+ import React from 'react'
2
+ import ReactDOM from 'react-dom/client'
3
+ import App from './App'
4
+ import './index.css'
5
+
6
+ ReactDOM.createRoot(document.getElementById('root')).render(
7
+ <React.StrictMode>
8
+ <App />
9
+ </React.StrictMode>
10
+ )
@@ -0,0 +1,10 @@
1
+ import { defineConfig } from 'npm:vite'
2
+ import react from 'npm:@vitejs/plugin-react'
3
+
4
+ import "npm:react";
5
+ import "npm:react-dom/client";
6
+
7
+ // https://vitejs.dev/config/
8
+ export default defineConfig({
9
+ plugins: [react()]
10
+ })
@@ -0,0 +1,3 @@
1
+ {
2
+ "recommendations": ["svelte.svelte-vscode"]
3
+ }
@@ -0,0 +1,30 @@
1
+ # Vite + Vue + Svelte
2
+
3
+ ## Running
4
+
5
+ You need to have Deno v1.25.4 or later intalled to run this repo.
6
+
7
+ Start a dev server:
8
+
9
+ ```
10
+ $ deno task dev
11
+ ```
12
+
13
+ ## Deploy
14
+
15
+ Build production assets:
16
+
17
+ ```
18
+ $ deno task build
19
+ ```
20
+
21
+ ## Notes
22
+
23
+ - You need to use `.mjs` or `.mts` extension for the `vite.config.[ext]` file.
24
+
25
+ ## Papercuts
26
+
27
+ Currently there's a "papercut" for Deno users:
28
+
29
+ - peer dependencies need to be referenced in `vite.config.js` - in this example
30
+ it is only `svelte` package that needs to be referenced
@@ -0,0 +1,8 @@
1
+ {
2
+ "tasks": {
3
+ "dev": "deno run -A --unstable --node-modules-dir npm:vite",
4
+ "build": "deno run -A --unstable --node-modules-dir npm:vite build",
5
+ "preview": "deno run -A --unstable --node-modules-dir npm:vite preview",
6
+ "serve": "deno run --allow-net --allow-read main.ts"
7
+ }
8
+ }
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Vite + Svelte</title>
8
+ </head>
9
+ <body>
10
+ <div id="app"></div>
11
+ <script type="module" src="/src/main.js"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1,34 @@
1
+ {
2
+ "compilerOptions": {
3
+ "moduleResolution": "Node",
4
+ "target": "ESNext",
5
+ "module": "ESNext",
6
+ /**
7
+ * svelte-preprocess cannot figure out whether you have
8
+ * a value or a type, so tell TypeScript to enforce using
9
+ * `import type` instead of `import` for Types.
10
+ */
11
+ "importsNotUsedAsValues": "error",
12
+ "isolatedModules": true,
13
+ "resolveJsonModule": true,
14
+ /**
15
+ * To have warnings / errors of the Svelte compiler at the
16
+ * correct position, enable source maps by default.
17
+ */
18
+ "sourceMap": true,
19
+ "esModuleInterop": true,
20
+ "skipLibCheck": true,
21
+ "forceConsistentCasingInFileNames": true,
22
+ "baseUrl": ".",
23
+ /**
24
+ * Typecheck JS in `.svelte` and `.js` files by default.
25
+ * Disable this if you'd like to use dynamic types.
26
+ */
27
+ "checkJs": true
28
+ },
29
+ /**
30
+ * Use global.d.ts instead of compilerOptions.types
31
+ * to avoid limiting type declarations.
32
+ */
33
+ "include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
34
+ }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1,45 @@
1
+ <script>
2
+ import svelteLogo from './assets/svelte.svg'
3
+ import Counter from './lib/Counter.svelte'
4
+ </script>
5
+
6
+ <main>
7
+ <div>
8
+ <a href="https://vitejs.dev" target="_blank">
9
+ <img src="/vite.svg" class="logo" alt="Vite Logo" />
10
+ </a>
11
+ <a href="https://svelte.dev" target="_blank">
12
+ <img src={svelteLogo} class="logo svelte" alt="Svelte Logo" />
13
+ </a>
14
+ </div>
15
+ <h1>Vite + Svelte</h1>
16
+
17
+ <div class="card">
18
+ <Counter />
19
+ </div>
20
+
21
+ <p>
22
+ Check out <a href="https://github.com/sveltejs/kit#readme" target="_blank">SvelteKit</a>, the official Svelte app framework powered by Vite!
23
+ </p>
24
+
25
+ <p class="read-the-docs">
26
+ Click on the Vite and Svelte logos to learn more
27
+ </p>
28
+ </main>
29
+
30
+ <style>
31
+ .logo {
32
+ height: 6em;
33
+ padding: 1.5em;
34
+ will-change: filter;
35
+ }
36
+ .logo:hover {
37
+ filter: drop-shadow(0 0 2em #646cffaa);
38
+ }
39
+ .logo.svelte:hover {
40
+ filter: drop-shadow(0 0 2em #ff3e00aa);
41
+ }
42
+ .read-the-docs {
43
+ color: #888;
44
+ }
45
+ </style>
@@ -0,0 +1,81 @@
1
+ :root {
2
+ font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
3
+ font-size: 16px;
4
+ line-height: 24px;
5
+ font-weight: 400;
6
+
7
+ color-scheme: light dark;
8
+ color: rgba(255, 255, 255, 0.87);
9
+ background-color: #242424;
10
+
11
+ font-synthesis: none;
12
+ text-rendering: optimizeLegibility;
13
+ -webkit-font-smoothing: antialiased;
14
+ -moz-osx-font-smoothing: grayscale;
15
+ -webkit-text-size-adjust: 100%;
16
+ }
17
+
18
+ a {
19
+ font-weight: 500;
20
+ color: #646cff;
21
+ text-decoration: inherit;
22
+ }
23
+ a:hover {
24
+ color: #535bf2;
25
+ }
26
+
27
+ body {
28
+ margin: 0;
29
+ display: flex;
30
+ place-items: center;
31
+ min-width: 320px;
32
+ min-height: 100vh;
33
+ }
34
+
35
+ h1 {
36
+ font-size: 3.2em;
37
+ line-height: 1.1;
38
+ }
39
+
40
+ .card {
41
+ padding: 2em;
42
+ }
43
+
44
+ #app {
45
+ max-width: 1280px;
46
+ margin: 0 auto;
47
+ padding: 2rem;
48
+ text-align: center;
49
+ }
50
+
51
+ button {
52
+ border-radius: 8px;
53
+ border: 1px solid transparent;
54
+ padding: 0.6em 1.2em;
55
+ font-size: 1em;
56
+ font-weight: 500;
57
+ font-family: inherit;
58
+ background-color: #1a1a1a;
59
+ cursor: pointer;
60
+ transition: border-color 0.25s;
61
+ }
62
+ button:hover {
63
+ border-color: #646cff;
64
+ }
65
+ button:focus,
66
+ button:focus-visible {
67
+ outline: 4px auto -webkit-focus-ring-color;
68
+ }
69
+
70
+ @media (prefers-color-scheme: light) {
71
+ :root {
72
+ color: #213547;
73
+ background-color: #ffffff;
74
+ }
75
+ a:hover {
76
+ color: #747bff;
77
+ }
78
+ button {
79
+ background-color: #f9f9f9;
80
+ }
81
+ }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="26.6" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 308"><path fill="#FF3E00" d="M239.682 40.707C211.113-.182 154.69-12.301 113.895 13.69L42.247 59.356a82.198 82.198 0 0 0-37.135 55.056a86.566 86.566 0 0 0 8.536 55.576a82.425 82.425 0 0 0-12.296 30.719a87.596 87.596 0 0 0 14.964 66.244c28.574 40.893 84.997 53.007 125.787 27.016l71.648-45.664a82.182 82.182 0 0 0 37.135-55.057a86.601 86.601 0 0 0-8.53-55.577a82.409 82.409 0 0 0 12.29-30.718a87.573 87.573 0 0 0-14.963-66.244"></path><path fill="#FFF" d="M106.889 270.841c-23.102 6.007-47.497-3.036-61.103-22.648a52.685 52.685 0 0 1-9.003-39.85a49.978 49.978 0 0 1 1.713-6.693l1.35-4.115l3.671 2.697a92.447 92.447 0 0 0 28.036 14.007l2.663.808l-.245 2.659a16.067 16.067 0 0 0 2.89 10.656a17.143 17.143 0 0 0 18.397 6.828a15.786 15.786 0 0 0 4.403-1.935l71.67-45.672a14.922 14.922 0 0 0 6.734-9.977a15.923 15.923 0 0 0-2.713-12.011a17.156 17.156 0 0 0-18.404-6.832a15.78 15.78 0 0 0-4.396 1.933l-27.35 17.434a52.298 52.298 0 0 1-14.553 6.391c-23.101 6.007-47.497-3.036-61.101-22.649a52.681 52.681 0 0 1-9.004-39.849a49.428 49.428 0 0 1 22.34-33.114l71.664-45.677a52.218 52.218 0 0 1 14.563-6.398c23.101-6.007 47.497 3.036 61.101 22.648a52.685 52.685 0 0 1 9.004 39.85a50.559 50.559 0 0 1-1.713 6.692l-1.35 4.116l-3.67-2.693a92.373 92.373 0 0 0-28.037-14.013l-2.664-.809l.246-2.658a16.099 16.099 0 0 0-2.89-10.656a17.143 17.143 0 0 0-18.398-6.828a15.786 15.786 0 0 0-4.402 1.935l-71.67 45.674a14.898 14.898 0 0 0-6.73 9.975a15.9 15.9 0 0 0 2.709 12.012a17.156 17.156 0 0 0 18.404 6.832a15.841 15.841 0 0 0 4.402-1.935l27.345-17.427a52.147 52.147 0 0 1 14.552-6.397c23.101-6.006 47.497 3.037 61.102 22.65a52.681 52.681 0 0 1 9.003 39.848a49.453 49.453 0 0 1-22.34 33.12l-71.664 45.673a52.218 52.218 0 0 1-14.563 6.398"></path></svg>
@@ -0,0 +1,10 @@
1
+ <script>
2
+ let count = 0
3
+ const increment = () => {
4
+ count += 1
5
+ }
6
+ </script>
7
+
8
+ <button on:click={increment}>
9
+ count is {count}
10
+ </button>
@@ -0,0 +1,8 @@
1
+ import './app.css'
2
+ import App from './App.svelte'
3
+
4
+ const app = new App({
5
+ target: document.getElementById('app')
6
+ })
7
+
8
+ export default app
@@ -0,0 +1,2 @@
1
+ /// <reference types="svelte" />
2
+ /// <reference types="vite/client" />
@@ -0,0 +1,9 @@
1
+ import { defineConfig } from 'npm:vite'
2
+ import { svelte } from 'npm:@sveltejs/vite-plugin-svelte'
3
+
4
+ import "npm:svelte";
5
+
6
+ // https://vitejs.dev/config/
7
+ export default defineConfig({
8
+ plugins: [svelte()]
9
+ })
@@ -0,0 +1,9 @@
1
+ export function setupCounter(element) {
2
+ let counter = 0
3
+ const setCounter = (count) => {
4
+ counter = count
5
+ element.innerHTML = `count is ${counter}`
6
+ }
7
+ element.addEventListener('click', () => setCounter(++counter))
8
+ setCounter(0)
9
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "tasks": {
3
+ "dev": "deno run -A --unstable --node-modules-dir npm:vite",
4
+ "build": "deno run -A --unstable --node-modules-dir npm:vite build",
5
+ "preview": "deno run -A --unstable --node-modules-dir npm:vite preview",
6
+ "serve": "deno run --allow-net --allow-read main.ts"
7
+ }
8
+ }
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Vite App</title>
8
+ </head>
9
+ <body>
10
+ <div id="app"></div>
11
+ <script type="module" src="/main.js"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="32" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path fill="#F7DF1E" d="M0 0h256v256H0V0Z"></path><path d="m67.312 213.932l19.59-11.856c3.78 6.701 7.218 12.371 15.465 12.371c7.905 0 12.89-3.092 12.89-15.12v-81.798h24.057v82.138c0 24.917-14.606 36.259-35.916 36.259c-19.245 0-30.416-9.967-36.087-21.996m85.07-2.576l19.588-11.341c5.157 8.421 11.859 14.607 23.715 14.607c9.969 0 16.325-4.984 16.325-11.858c0-8.248-6.53-11.17-17.528-15.98l-6.013-2.58c-17.357-7.387-28.87-16.667-28.87-36.257c0-18.044 13.747-31.792 35.228-31.792c15.294 0 26.292 5.328 34.196 19.247l-18.732 12.03c-4.125-7.389-8.591-10.31-15.465-10.31c-7.046 0-11.514 4.468-11.514 10.31c0 7.217 4.468 10.14 14.778 14.608l6.014 2.577c20.45 8.765 31.963 17.7 31.963 37.804c0 21.654-17.012 33.51-39.867 33.51c-22.339 0-36.774-10.654-43.819-24.574"></path></svg>
@@ -0,0 +1,23 @@
1
+ import './style.css'
2
+ import javascriptLogo from './javascript.svg'
3
+ import { setupCounter } from './counter.js'
4
+
5
+ document.querySelector('#app').innerHTML = `
6
+ <div>
7
+ <a href="https://vitejs.dev" target="_blank">
8
+ <img src="/vite.svg" class="logo" alt="Vite logo" />
9
+ </a>
10
+ <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript" target="_blank">
11
+ <img src="${javascriptLogo}" class="logo vanilla" alt="JavaScript logo" />
12
+ </a>
13
+ <h1>Hello Vite!</h1>
14
+ <div class="card">
15
+ <button id="counter" type="button"></button>
16
+ </div>
17
+ <p class="read-the-docs">
18
+ Click on the Vite logo to learn more
19
+ </p>
20
+ </div>
21
+ `
22
+
23
+ setupCounter(document.querySelector('#counter'))
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1,97 @@
1
+ :root {
2
+ font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
3
+ font-size: 16px;
4
+ line-height: 24px;
5
+ font-weight: 400;
6
+
7
+ color-scheme: light dark;
8
+ color: rgba(255, 255, 255, 0.87);
9
+ background-color: #242424;
10
+
11
+ font-synthesis: none;
12
+ text-rendering: optimizeLegibility;
13
+ -webkit-font-smoothing: antialiased;
14
+ -moz-osx-font-smoothing: grayscale;
15
+ -webkit-text-size-adjust: 100%;
16
+ }
17
+
18
+ a {
19
+ font-weight: 500;
20
+ color: #646cff;
21
+ text-decoration: inherit;
22
+ }
23
+ a:hover {
24
+ color: #535bf2;
25
+ }
26
+
27
+ body {
28
+ margin: 0;
29
+ display: flex;
30
+ place-items: center;
31
+ min-width: 320px;
32
+ min-height: 100vh;
33
+ }
34
+
35
+ h1 {
36
+ font-size: 3.2em;
37
+ line-height: 1.1;
38
+ }
39
+
40
+ #app {
41
+ max-width: 1280px;
42
+ margin: 0 auto;
43
+ padding: 2rem;
44
+ text-align: center;
45
+ }
46
+
47
+ .logo {
48
+ height: 6em;
49
+ padding: 1.5em;
50
+ will-change: filter;
51
+ }
52
+ .logo:hover {
53
+ filter: drop-shadow(0 0 2em #646cffaa);
54
+ }
55
+ .logo.vanilla:hover {
56
+ filter: drop-shadow(0 0 2em #f7df1eaa);
57
+ }
58
+
59
+ .card {
60
+ padding: 2em;
61
+ }
62
+
63
+ .read-the-docs {
64
+ color: #888;
65
+ }
66
+
67
+ button {
68
+ border-radius: 8px;
69
+ border: 1px solid transparent;
70
+ padding: 0.6em 1.2em;
71
+ font-size: 1em;
72
+ font-weight: 500;
73
+ font-family: inherit;
74
+ background-color: #1a1a1a;
75
+ cursor: pointer;
76
+ transition: border-color 0.25s;
77
+ }
78
+ button:hover {
79
+ border-color: #646cff;
80
+ }
81
+ button:focus,
82
+ button:focus-visible {
83
+ outline: 4px auto -webkit-focus-ring-color;
84
+ }
85
+
86
+ @media (prefers-color-scheme: light) {
87
+ :root {
88
+ color: #213547;
89
+ background-color: #ffffff;
90
+ }
91
+ a:hover {
92
+ color: #747bff;
93
+ }
94
+ button {
95
+ background-color: #f9f9f9;
96
+ }
97
+ }
@@ -1,22 +1,4 @@
1
- # Vite + Deno
2
-
3
- This is an example repo of running Vite with Deno.
4
-
5
- You can see live site at: https://vite-deno-example.deno.dev
6
-
7
- This repo is based on `vue` template for Vite:
8
- https://stackblitz.com/edit/vitejs-vite-ifm7jc?file=index.html&terminal=dev
9
-
10
- ## Notes
11
-
12
- - You need to use `.mjs` or `.mts` extension for the `vite.config.[ext]` file.
13
-
14
- ## Papercuts
15
-
16
- Currently there's a "papercut" for Deno users:
17
-
18
- - peer dependencies need to be referenced in `vite.config.js` - in this example
19
- it is only `vue` package that needs to be referenced
1
+ # Vite + Vue + Deno
20
2
 
21
3
  ## Running
22
4
 
@@ -36,6 +18,13 @@ Build production assets:
36
18
  $ deno task build
37
19
  ```
38
20
 
39
- This repository uses
40
- [Deno Deploy and Git integration](https://deno.com/deploy/docs/projects#git-integration),
41
- where deployment is happening as part of the CI pipeline.
21
+ ## Notes
22
+
23
+ - You need to use `.mjs` or `.mts` extension for the `vite.config.[ext]` file.
24
+
25
+ ## Papercuts
26
+
27
+ Currently there's a "papercut" for Deno users:
28
+
29
+ - peer dependencies need to be referenced in `vite.config.js` - in this example
30
+ it is only `vue` package that needs to be referenced