Skip to content

Commit

Permalink
feat(create-vite): migrate lit-element to lit (vitejs#5012)
Browse files Browse the repository at this point in the history
  • Loading branch information
rodydavis authored and aleclarson committed Nov 8, 2021
1 parent f86b780 commit 926d0c5
Show file tree
Hide file tree
Showing 18 changed files with 22 additions and 21 deletions.
4 changes: 2 additions & 2 deletions docs/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ Supported template presets include:
- `react-ts`
- `preact`
- `preact-ts`
- `lit-element`
- `lit-element-ts`
- `lit`
- `lit-ts`
- `svelte`
- `svelte-ts`

Expand Down
4 changes: 2 additions & 2 deletions packages/create-vite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ Currently supported template presets include:
- `react-ts`
- `preact`
- `preact-ts`
- `lit-element`
- `lit-element-ts`
- `lit`
- `lit-ts`
- `svelte`
- `svelte-ts`

Expand Down
6 changes: 3 additions & 3 deletions packages/create-vite/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,16 @@ const FRAMEWORKS = [
]
},
{
name: 'lit-element',
name: 'lit',
color: lightRed,
variants: [
{
name: 'lit-element',
name: 'lit',
display: 'JavaScript',
color: yellow
},
{
name: 'lit-element-ts',
name: 'lit-ts',
display: 'TypeScript',
color: blue
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/src/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Lit-Element App</title>
<title>Vite + Lit App</title>
<script type="module" src="/src/my-element.ts"></script>
</head>
<body>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "vite-lit-element-ts-starter",
"name": "vite-lit-ts-starter",
"version": "0.0.0",
"main": "dist/my-element.es.js",
"exports": {
Expand All @@ -15,7 +15,7 @@
"build": "tsc && vite build"
},
"dependencies": {
"lit-element": "^2.4.0"
"lit": "^2.0.0"
},
"devDependencies": {
"vite": "^2.5.4",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { LitElement, html, customElement, property, css } from 'lit-element'
import { html, css, LitElement } from 'lit'
import { customElement, property } from 'lit/decorators.js'

/**
* An example element.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default defineConfig({
formats: ['es']
},
rollupOptions: {
external: /^lit-element/
external: /^lit/
}
}
})
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
node_modules
.DS_Store
dist
dist-ssr
types
*.local
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/src/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Lit-Element App</title>
<title>Vite + Lit App</title>
<script type="module" src="/src/my-element.js"></script>
</head>
<body>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "vite-lit-element-starter",
"name": "vite-lit-starter",
"version": "0.0.0",
"main": "dist/my-element.es.js",
"exports": {
Expand All @@ -13,7 +13,7 @@
"build": "vite build"
},
"dependencies": {
"lit-element": "^2.4.0"
"lit": "^2.0.0"
},
"devDependencies": {
"vite": "^2.5.4"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LitElement, html, css } from 'lit-element'
import { html, css, LitElement } from 'lit'

/**
* An example element.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default defineConfig({
formats: ['es']
},
rollupOptions: {
external: /^lit-element/
external: /^lit/
}
}
})
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<template>
<div>Example external component content</div>
</template>
<template>
<div>Example external component content</div>
</template>

0 comments on commit 926d0c5

Please sign in to comment.