Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

feat: Add nuxt windicss. #753

Merged
merged 4 commits into from
Mar 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -48,6 +48,7 @@ yarn create nuxt-app <my-project>
- [Oruga](https://oruga.io/)
- [Tachyons](https://github.com/tachyons-css/tachyons)
- [Tailwind CSS](https://github.com/tailwindcss/tailwindcss)
- [Windi CSS](https://github.com/windicss/windicss)
- [Vant](https://github.com/youzan/vant)
- [View UI](https://www.iviewui.com/)
- [Vuesax](https://github.com/lusaxweb/vuesax)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"devDependencies": {
"nuxt-windicss": "^0.4.1"
}
}
3 changes: 3 additions & 0 deletions packages/cna-template/template/nuxt/nuxt.config.js
Original file line number Diff line number Diff line change
@@ -95,6 +95,9 @@
// https://go.nuxtjs.dev/stylelint
'@nuxtjs/stylelint-module',
<%_ } _%>
<%_ if (ui === 'windicss') { _%>
'nuxt-windicss',
<%_ } _%>
<%_ if (ui === 'tailwind') { _%>
// https://go.nuxtjs.dev/tailwindcss
'@nuxtjs/tailwindcss',
1 change: 1 addition & 0 deletions packages/create-nuxt-app/lib/prompts.js
Original file line number Diff line number Diff line change
@@ -41,6 +41,7 @@ module.exports = [
{ name: 'Oruga', value: 'oruga' },
{ name: 'Tachyons', value: 'tachyons' },
{ name: 'Tailwind CSS', value: 'tailwind' },
{ name: 'Windi CSS', value: 'windicss' },
{ name: 'Vant', value: 'vant' },
{ name: 'View UI', value: 'view-ui' },
{ name: 'Vuesax', value: 'vuesax' },
88 changes: 88 additions & 0 deletions packages/create-nuxt-app/test/snapshots/index.test.js.md
Original file line number Diff line number Diff line change
@@ -1424,6 +1424,94 @@ Generated by [AVA](https://avajs.dev).
}␊
`

## verify ui: Windi CSS

> Generated files
[
'.editorconfig',
'.gitignore',
'README.md',
'assets/README.md',
'components/Logo.vue',
'components/README.md',
'layouts/README.md',
'layouts/default.vue',
'middleware/README.md',
'nuxt.config.js',
'package.json',
'pages/README.md',
'pages/index.vue',
'plugins/README.md',
'static/README.md',
'static/favicon.ico',
'store/README.md',
]

> package.json
{
dependencies: {
'core-js': '^3.9.1',
nuxt: '^2.15.3',
},
devDependencies: {
'nuxt-windicss': '^0.4.1',
},
private: true,
scripts: {
build: 'nuxt build',
dev: 'nuxt',
generate: 'nuxt generate',
start: 'nuxt start',
},
}

> Generated nuxt.config.js
`export default {␊
// Global page headers: https://go.nuxtjs.dev/config-head␊
head: {␊
title: 'output',␊
htmlAttrs: {␊
lang: 'en'␊
},␊
meta: [␊
{ charset: 'utf-8' },␊
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },␊
{ hid: 'description', name: 'description', content: '' }␊
],␊
link: [␊
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }␊
]␊
},␊
// Global CSS: https://go.nuxtjs.dev/config-css␊
css: [␊
],␊
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins␊
plugins: [␊
],␊
// Auto import components: https://go.nuxtjs.dev/config-components␊
components: true,␊
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules␊
buildModules: [␊
'nuxt-windicss',␊
],␊
// Modules: https://go.nuxtjs.dev/config-modules␊
modules: [␊
],␊
// Build Configuration: https://go.nuxtjs.dev/config-build␊
build: {␊
}␊
}␊
`

## verify ui: Vant

> Generated files
Binary file modified packages/create-nuxt-app/test/snapshots/index.test.js.snap
Binary file not shown.