From 9181c1bf3e0678cfabcfc6801332627a065bd05b Mon Sep 17 00:00:00 2001 From: sonofmagic <1324318532@qq.com> Date: Wed, 19 Apr 2023 23:21:59 +0800 Subject: [PATCH] chore: vite-svelte case commit --- apps/vite-svelte/index.html | 2 +- apps/vite-svelte/package.json | 9 ++++++--- apps/vite-svelte/postcss.config.cjs | 6 ++++++ apps/vite-svelte/src/App.svelte | 4 ++-- apps/vite-svelte/src/app.css | 4 ++++ apps/vite-svelte/tailwind.config.js | 8 ++++++++ apps/vite-svelte/vite.config.ts | 4 ++-- pnpm-lock.yaml | 15 +++++++++++---- 8 files changed, 40 insertions(+), 12 deletions(-) create mode 100644 apps/vite-svelte/postcss.config.cjs create mode 100644 apps/vite-svelte/tailwind.config.js diff --git a/apps/vite-svelte/index.html b/apps/vite-svelte/index.html index b5b12526..328da060 100644 --- a/apps/vite-svelte/index.html +++ b/apps/vite-svelte/index.html @@ -7,7 +7,7 @@ Vite + Svelte + TS -
+
diff --git a/apps/vite-svelte/package.json b/apps/vite-svelte/package.json index 081ad446..56296db6 100644 --- a/apps/vite-svelte/package.json +++ b/apps/vite-svelte/package.json @@ -12,12 +12,15 @@ "devDependencies": { "@sveltejs/vite-plugin-svelte": "^2.0.3", "@tsconfig/svelte": "^3.0.0", + "autoprefixer": "^10.4.14", + "postcss": "^8.4.22", "svelte": "^3.55.1", "svelte-check": "^2.10.3", + "tailwindcss": "^3.3.1", + "tailwindcss-patch": "workspace:*", "tslib": "^2.5.0", "typescript": "^4.9.3", - "vite": "^4.2.0", - "tailwindcss-patch": "workspace:*", - "unplugin-tailwindcss-mangle": "workspace:*" + "unplugin-tailwindcss-mangle": "workspace:*", + "vite": "^4.2.0" } } diff --git a/apps/vite-svelte/postcss.config.cjs b/apps/vite-svelte/postcss.config.cjs new file mode 100644 index 00000000..85f717cc --- /dev/null +++ b/apps/vite-svelte/postcss.config.cjs @@ -0,0 +1,6 @@ +module.exports = { + plugins: { + tailwindcss: {}, + autoprefixer: {} + } +} diff --git a/apps/vite-svelte/src/App.svelte b/apps/vite-svelte/src/App.svelte index e8b590f1..56536b3e 100644 --- a/apps/vite-svelte/src/App.svelte +++ b/apps/vite-svelte/src/App.svelte @@ -5,7 +5,7 @@
-
+
@@ -13,7 +13,7 @@
-

Vite + Svelte

+

Vite + Svelte

diff --git a/apps/vite-svelte/src/app.css b/apps/vite-svelte/src/app.css index b87aec72..0a73f609 100644 --- a/apps/vite-svelte/src/app.css +++ b/apps/vite-svelte/src/app.css @@ -1,3 +1,7 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + :root { font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; line-height: 1.5; diff --git a/apps/vite-svelte/tailwind.config.js b/apps/vite-svelte/tailwind.config.js new file mode 100644 index 00000000..96d6a5a4 --- /dev/null +++ b/apps/vite-svelte/tailwind.config.js @@ -0,0 +1,8 @@ +/** @type {import('tailwindcss').Config} */ +module.exports = { + content: ['./index.html', './src/**/*.{html,js,svelte,ts}'], + theme: { + extend: {} + }, + plugins: [] +} diff --git a/apps/vite-svelte/vite.config.ts b/apps/vite-svelte/vite.config.ts index 401b4d4b..23551621 100644 --- a/apps/vite-svelte/vite.config.ts +++ b/apps/vite-svelte/vite.config.ts @@ -1,7 +1,7 @@ import { defineConfig } from 'vite' import { svelte } from '@sveltejs/vite-plugin-svelte' - +import { vitePlugin as utwm } from 'unplugin-tailwindcss-mangle' // https://vitejs.dev/config/ export default defineConfig({ - plugins: [svelte()] + plugins: [svelte(), utwm()] }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e834871f..0bb32e77 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -104,8 +104,11 @@ importers: specifiers: '@sveltejs/vite-plugin-svelte': ^2.0.3 '@tsconfig/svelte': ^3.0.0 + autoprefixer: ^10.4.14 + postcss: ^8.4.22 svelte: ^3.55.1 svelte-check: ^2.10.3 + tailwindcss: ^3.3.1 tailwindcss-patch: workspace:* tslib: ^2.5.0 typescript: ^4.9.3 @@ -114,8 +117,11 @@ importers: devDependencies: '@sveltejs/vite-plugin-svelte': 2.0.4_svelte@3.58.0+vite@4.2.2 '@tsconfig/svelte': 3.0.0 + autoprefixer: 10.4.14_postcss@8.4.22 + postcss: 8.4.22 svelte: 3.58.0 - svelte-check: 2.10.3_svelte@3.58.0 + svelte-check: 2.10.3_bafhujc2cbpwtmcqmh7alvqarq + tailwindcss: 3.3.1_postcss@8.4.22 tailwindcss-patch: link:../../packages/tailwindcss-patch tslib: 2.5.0 typescript: 4.9.5 @@ -10010,7 +10016,7 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - /svelte-check/2.10.3_svelte@3.58.0: + /svelte-check/2.10.3_bafhujc2cbpwtmcqmh7alvqarq: resolution: {integrity: sha512-Nt1aWHTOKFReBpmJ1vPug0aGysqPwJh2seM1OvICfM2oeyaA62mOiy5EvkXhltGfhCcIQcq2LoE0l1CwcWPjlw==} hasBin: true peerDependencies: @@ -10023,7 +10029,7 @@ packages: picocolors: 1.0.0 sade: 1.8.1 svelte: 3.58.0 - svelte-preprocess: 4.10.7_kxq5ayp4qfv2n6flkngpsntzw4 + svelte-preprocess: 4.10.7_ya7ux77m4y6dr5ryopvq3m2l2i typescript: 5.0.4 transitivePeerDependencies: - '@babel/core' @@ -10047,7 +10053,7 @@ packages: svelte: 3.58.0 dev: true - /svelte-preprocess/4.10.7_kxq5ayp4qfv2n6flkngpsntzw4: + /svelte-preprocess/4.10.7_ya7ux77m4y6dr5ryopvq3m2l2i: resolution: {integrity: sha512-sNPBnqYD6FnmdBrUmBCaqS00RyCsCpj2BG58A1JBswNF7b0OKviwxqVrOL/CKyJrLSClrSeqQv5BXNg2RUbPOw==} engines: {node: '>= 9.11.2'} requiresBuild: true @@ -10092,6 +10098,7 @@ packages: '@types/sass': 1.45.0 detect-indent: 6.1.0 magic-string: 0.25.9 + postcss: 8.4.22 sorcery: 0.10.0 strip-indent: 3.0.0 svelte: 3.58.0