Live at: https://determined-ride-d3788b.netlify.app/
Set of starter templates for using Vue with Vite and Tailwind2 (optionally with linting tools and jest testing). PostCSS 8 caused some problems with running Vite with Tailwind2, but the Tailwind team released a backwards compatible package and setup guide to make it hurt less (for the time being).
Simple skeleton akin to create vite app, with tailwind styling and a dark mode toggle hook that respects browser local storage & OS preferences.
Different templates are per branch, with main
including testing and linting setup.
Feel free to hack / change / fork, MIT license. Cheers :beers:
NOTE Vite and Vue Test Utils 2 are still in beta. This will most likely be updated in the future.
Vue Test Utils 2 (targets vue3)
Clone / download zip / Use Degit to fetch the template.
Feel free to use npm instead of yarn.
# or gerardrbentley/vue3-tailwind2-starter#bare
# or gerardrbentley/vue3-tailwind2-starter#lint
$ degit gerardrbentley/vue3-tailwind2-starter#tested DEST_FOLDER
$ cd DEST_FOLDER
$ yarn
$ yarn dev
# Server should be running on port 3000
# Build production files in ./dist/
$ yarn build
# Run a server with npx http-server ./dist or python -m http.server --directory dist
Simple Starter Code akin to create-vite-app, but with Tailwind and dark-mode toggle set up.
Packages:
Files:
tailwind.config.js
: extend tailwind's base theme (new colors, sizes, more dark variants)postcss.config.js
: necessary for tailwindtsconfig.json
: create-vite-app default typescript configsrc/App.vue
: main component for Vue, contains logic for dark-mode and an example of using tailwind in a templatesrc/index.css
: used in main.ts
for the whole app. Has examples for styling classes, id's, and elements.src/vue-app-env.d.ts
: used to enable vite's module loadingCommands:
yarn dev
yarn build
Packages:
...bare +
Files:
.eslintrc.js
: setup for eslint.prettierrc.json
: setup for prettier.eslintignore
: ignored files during eslintCommands:
yarn dev
yarn build
yarn lint
: prettier + eslint + typecheck, no fixingyarn fix
: above, with fixing (except unfixables)TODO: investigate xComponent.spec.vue pattern, only xComponent.spec.ts works at the moment
...lint +
Files:
jest.config
: specifies jest to use "jsdom", run tests on any file that matches xxx.spec.ts or xxx.spec.vue (only .ts works, but .vue is supposed to)src/App.spec.ts
: Tests vue app mounting and useTailwindDarkMode hook using jest mocksrc/components/HelloWorld.spec.ts
: Tests a single component and its functionsrc/shims-vue.d.ts
: Enables jest to play nicelyCommands:
yarn test
: runs jest testing command