Skip to content

Commit 6f0b858

Browse files
committed
feat: 添加样式重置
1 parent 10b368e commit 6f0b858

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

packages/cli/src/actions/project.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export async function createMonoRepoProject(dir: string) {
179179
dependencies.push(uiSelection)
180180
}
181181

182-
dependencies.push('vue', 'vue-router')
182+
dependencies.push('vue', 'vue-router', '@unocss/reset')
183183
}
184184

185185
const devDependencies = [
@@ -317,10 +317,10 @@ export async function createMonoRepoProject(dir: string) {
317317
await execa(pnpm, ['install', ...dependencies], { stdio: 'inherit', cwd })
318318
}
319319
else if (framework === 'react') {
320-
await execa(pnpm, ['install', 'react', 'react-dom'], { stdio: 'inherit', cwd })
320+
await execa(pnpm, ['install', 'react', 'react-dom', '@unocss/reset'], { stdio: 'inherit', cwd })
321321
}
322322
else if (framework === 'nuxt') {
323-
await execa(pnpm, ['install', 'nuxt', 'vue', 'vue-router', ...dependencies], { stdio: 'inherit', cwd })
323+
await execa(pnpm, ['install', 'nuxt', 'vue', 'vue-router', '@unocss/reset', ...dependencies], { stdio: 'inherit', cwd })
324324

325325
await execa(pnpm, ['prepare'], { stdio: 'inherit', cwd })
326326
}

packages/cli/src/nuxt/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { createWorkflow } from '../actions'
3131
export async function createNuxtProject(dir: string) {
3232
const cwd = join(process.cwd(), dir)
3333

34-
const dependencies = ['nuxt', 'vue', 'vue-router']
34+
const dependencies = ['nuxt', 'vue', 'vue-router', '@unocss/reset']
3535
const devDependencies = ['@commitlint/cli', '@commitlint/config-conventional', 'lint-staged', 'simple-git-hooks', '@types/node', 'unocss', '@unocss/nuxt', '@antfu/eslint-config', 'eslint', 'eslint-plugin-format', '@unocss/eslint-plugin']
3636

3737
try {

packages/cli/src/react/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export async function createReactProject(dir: string) {
3737
createWorkflow(cwd, 'ci.yml', ciWorkflow())
3838

3939
const devDependencies = ['@commitlint/cli', '@commitlint/config-conventional', 'lint-staged', 'simple-git-hooks', 'unocss', 'typescript', '@types/node', 'vite', '@vitejs/plugin-react', '@types/react', '@types/react-dom', '@antfu/eslint-config', 'eslint', 'eslint-plugin-format', '@unocss/eslint-plugin', '@eslint-react/eslint-plugin', 'eslint-plugin-react-hooks', 'eslint-plugin-react-refresh']
40-
const dependencies = ['react', 'react-dom']
40+
const dependencies = ['react', 'react-dom', '@unocss/reset']
4141

4242
await execa('git', ['init'], { stdio: 'inherit', cwd })
4343

packages/cli/src/vue/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export async function createVueProject(dir: string) {
5555
'typescript',
5656
]
5757

58-
const dependencies = ['vue', 'vue-router']
58+
const dependencies = ['vue', 'vue-router', '@unocss/reset']
5959

6060
if (!isEmpty(uiSelection)) {
6161
dependencies.push(uiSelection)

packages/utils/src/configFiles.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ export function vueMainFile(ui: UiKeys) {
205205
isEmpty(uiName) ? null : `import ${uiName} from '${ui}'`,
206206
'import App from \'./App.vue\'',
207207
'import router from \'./router\'',
208+
'import \'@unocss/reset/tailwind.css\'',
208209
'import \'virtual:uno.css\'',
209210
isEmpty(uiCSSName) ? null : `import '${uiCSSMap[ui]}'`,
210211
'',
@@ -251,6 +252,7 @@ export const reactMainFile = [
251252
'import { StrictMode } from \'react\'',
252253
'import { createRoot } from \'react-dom/client\'',
253254
'import App from \'./App.tsx\'',
255+
'import \'@unocss/reset/tailwind.css\'',
254256
'import \'virtual:uno.css\'',
255257
'',
256258
'createRoot(document.getElementById(\'root\')!).render(',

0 commit comments

Comments
 (0)