Skip to content

Commit

Permalink
unocss
Browse files Browse the repository at this point in the history
  • Loading branch information
YuFengjie97 committed Sep 25, 2023
1 parent 8b3c52b commit 4f6caa7
Show file tree
Hide file tree
Showing 8 changed files with 754 additions and 26 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@

> 一个项目模板
## use pnpm
## use pnpm

```bash
pnpm i
pnpm run dev
```
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"eslint": "^8.50.0",
"less": "^4.2.0",
"typescript": "^5.0.2",
"unocss": "^0.56.1",
"vite": "^4.4.5",
"vue-tsc": "^1.8.5"
}
Expand Down
722 changes: 720 additions & 2 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ import { createApp } from 'vue'
import './style.less'
import App from './App.vue'
import { router } from '@/router'
import 'virtual:uno.css'

createApp(App).use(router).mount('#app')
4 changes: 3 additions & 1 deletion src/views/home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

<template>
<div class="view-con">
<h1>home</h1>
<h1 class="bg-white font-italic">
home
</h1>
</div>
</template>

Expand Down
27 changes: 11 additions & 16 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@
{
"compilerOptions": {
"target": "ES2020",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"jsx": "preserve",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"types": ["node"],
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "node",
"paths": {
"@/*": ["./src/*"]
},
"types": ["node"],
// "allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve",

/* Linting */
"isolatedModules": true,
"strict": true,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,

"paths": {
"@/*": ["./src/*"]
}
"skipLibCheck": true
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
"exclude": ["tsconfig.json", "tsconfig.node.json", "node_modules"],
"references": [{ "path": "./tsconfig.node.json" }],
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
"exclude": ["tsconfig.json", "tsconfig.node.json", "node_modules"]
}
6 changes: 6 additions & 0 deletions unocss.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// uno.config.ts
import { defineConfig } from 'unocss'

export default defineConfig({
// ...UnoCSS options
})
12 changes: 6 additions & 6 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { resolve } from 'node:path'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import {resolve} from 'path'

import UnoCSS from 'unocss/vite'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
plugins: [UnoCSS(), vue()],
resolve: {
alias: {
'@': resolve(__dirname, 'src')
}
}
'@': resolve(__dirname, 'src'),
},
},
})

0 comments on commit 4f6caa7

Please sign in to comment.