From 8186b9b2b0734544ec37412de7ec2606ba8b1359 Mon Sep 17 00:00:00 2001 From: fi3ework Date: Tue, 21 Mar 2023 16:50:11 +0800 Subject: [PATCH] feat(create-vite): lit templates will create application instead of library (#12459) --- packages/create-vite/template-lit-ts/package.json | 12 ++---------- packages/create-vite/template-lit-ts/tsconfig.json | 7 ++----- .../create-vite/template-lit-ts/tsconfig.node.json | 9 --------- .../create-vite/template-lit-ts/vite.config.ts | 14 -------------- packages/create-vite/template-lit/package.json | 10 ++-------- packages/create-vite/template-lit/vite.config.js | 14 -------------- 6 files changed, 6 insertions(+), 60 deletions(-) delete mode 100644 packages/create-vite/template-lit-ts/tsconfig.node.json delete mode 100644 packages/create-vite/template-lit-ts/vite.config.ts delete mode 100644 packages/create-vite/template-lit/vite.config.js diff --git a/packages/create-vite/template-lit-ts/package.json b/packages/create-vite/template-lit-ts/package.json index dd1ec15d9ca261..1621a916b6d495 100644 --- a/packages/create-vite/template-lit-ts/package.json +++ b/packages/create-vite/template-lit-ts/package.json @@ -3,18 +3,10 @@ "private": true, "version": "0.0.0", "type": "module", - "main": "dist/my-element.es.js", - "exports": { - ".": "./dist/my-element.es.js" - }, - "types": "types/my-element.d.ts", - "files": [ - "dist", - "types" - ], "scripts": { "dev": "vite", - "build": "tsc && vite build" + "build": "tsc && vite build", + "preview": "vite preview" }, "dependencies": { "lit": "^2.6.1" diff --git a/packages/create-vite/template-lit-ts/tsconfig.json b/packages/create-vite/template-lit-ts/tsconfig.json index b080b2b2cd41a7..82155643958d44 100644 --- a/packages/create-vite/template-lit-ts/tsconfig.json +++ b/packages/create-vite/template-lit-ts/tsconfig.json @@ -2,9 +2,7 @@ "compilerOptions": { "module": "ESNext", "lib": ["ES2020", "DOM", "DOM.Iterable"], - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "./types", + "noEmit": true, "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, @@ -18,6 +16,5 @@ "useDefineForClassFields": false, "skipLibCheck": true }, - "include": ["src/**/*.ts"], - "references": [{ "path": "./tsconfig.node.json" }] + "include": ["src"] } diff --git a/packages/create-vite/template-lit-ts/tsconfig.node.json b/packages/create-vite/template-lit-ts/tsconfig.node.json deleted file mode 100644 index 9d31e2aed93c87..00000000000000 --- a/packages/create-vite/template-lit-ts/tsconfig.node.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "module": "ESNext", - "moduleResolution": "Node", - "allowSyntheticDefaultImports": true - }, - "include": ["vite.config.ts"] -} diff --git a/packages/create-vite/template-lit-ts/vite.config.ts b/packages/create-vite/template-lit-ts/vite.config.ts deleted file mode 100644 index fe69491e390523..00000000000000 --- a/packages/create-vite/template-lit-ts/vite.config.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { defineConfig } from 'vite' - -// https://vitejs.dev/config/ -export default defineConfig({ - build: { - lib: { - entry: 'src/my-element.ts', - formats: ['es'], - }, - rollupOptions: { - external: /^lit/, - }, - }, -}) diff --git a/packages/create-vite/template-lit/package.json b/packages/create-vite/template-lit/package.json index 2859e3cfd42125..bbabef0a7ab0de 100644 --- a/packages/create-vite/template-lit/package.json +++ b/packages/create-vite/template-lit/package.json @@ -3,16 +3,10 @@ "private": true, "version": "0.0.0", "type": "module", - "main": "dist/my-element.es.js", - "exports": { - ".": "./dist/my-element.es.js" - }, - "files": [ - "dist" - ], "scripts": { "dev": "vite", - "build": "vite build" + "build": "vite build", + "preview": "vite preview" }, "dependencies": { "lit": "^2.6.1" diff --git a/packages/create-vite/template-lit/vite.config.js b/packages/create-vite/template-lit/vite.config.js deleted file mode 100644 index 3847c1f38466f1..00000000000000 --- a/packages/create-vite/template-lit/vite.config.js +++ /dev/null @@ -1,14 +0,0 @@ -import { defineConfig } from 'vite' - -// https://vitejs.dev/config/ -export default defineConfig({ - build: { - lib: { - entry: 'src/my-element.js', - formats: ['es'], - }, - rollupOptions: { - external: /^lit/, - }, - }, -})