lstoeferle / vite-vue2-starter Goto Github PK
View Code? Open in Web Editor NEWVite - Vue 2 starter template using composition-api and windiCSS
License: MIT License
Vite - Vue 2 starter template using composition-api and windiCSS
License: MIT License
Dear @lstoeferle, I've tried to run your project locally but gets into problem.
Here are the steps of what I've done:
Here are the error:
> [email protected] dev E:\Data\Projects\testing\vue-test\vite-vue2-windicss-starter
> vite
error when starting dev server:
Error: The following dependencies are imported but could not be resolved:
vue-demi (imported by E:/Data/Projects/testing/vue-test/vite-vue2-windicss-starter/src/main.ts)
Are they installed?
at optimizeDeps (E:\Data\Projects\testing\vue-test\vite-vue2-windicss-starter\node_modules\.pnpm\[email protected]\node_modules\vite\dist\node\chunks\dep-00e79b84.js:67615:15)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async runOptimize (E:\Data\Projects\testing\vue-test\vite-vue2-windicss-starter\node_modules\.pnpm\[email protected]\node_modules\vite\dist\node\chunks\dep-00e79b84.js:68170:48)
at async Server.httpServer.listen (E:\Data\Projects\testing\vue-test\vite-vue2-windicss-starter\node_modules\.pnpm\[email protected]\node_modules\vite\dist\node\chunks\dep-00e79b84.js:68184:17)
ERROR Command failed with exit code 1.
Looks like vue-demi is missing from package.json.
Regards,
Martinus
I have a weird issue where env variables are available in my App.vue file but when importing other components for App.vue the env variables give undefined in those components.
Couldn't find anything related on SO or Google. Could it have anything to do with how it's implemented in this template?
I must say I'm new to Typescript and Vite as a whole but any tips?
Also thank you very much for this template! Already learned a ton with it!
In the Commits on Mar 27, 2021(7c3c055600d5c43156ae720f0add52a62398791e)
Incorrect spacing between Feature components ( Features.vue ).
<div class="w-full py-4 pr-4 xs:pl-4 md:w-1/2 lg:w-1/4">
<Feature
title="vite-plugin-vue2"
text="Vue 2 support for Vite"
url="https://github.com/underfin/vite-plugin-vue2"
/>
</div>
<div class="w-full p-4 md:w-1/2 lg:w-1/4">
<Feature
title="vite-plugin-components"
text="On demand components auto importing for Vite"
url="https://github.com/antfu/vite-plugin-components"
/>
</div>
I don't know if the author did it on purpose.
I guess I should write it this way——
<div class="w-full py-4 px-2 xs:pr-4 md:w-1/2 lg:w-1/4">
<Feature
title="vite-plugin-vue2"
text="Vue 2 support for Vite"
url="https://github.com/underfin/vite-plugin-vue2"
/>
</div>
<div class="w-full py-4 px-2 xs:pr-4 md:w-1/2 lg:w-1/4">
<Feature
title="vite-plugin-components"
text="On demand components auto importing for Vite"
url="https://github.com/antfu/vite-plugin-components"
/>
</div>
Hi @lstoeferle, I pulled it down and get it running. I'd say I am really impressed by the template layouts and the code structure. I think it will be great for people to have a quick preview of it if you can deploy it as a live demo. 👍
my vite config according vite docs
import path from 'path'
import { defineConfig } from 'vite'
import { createVuePlugin as Vue2 } from 'vite-plugin-vue2'
import WindiCSS from 'vite-plugin-windicss'
import Components from 'unplugin-vue-components/vite'
import Icons from 'unplugin-icons/vite'
import IconsResolver from 'unplugin-icons/resolver'
import ScriptSetup from 'unplugin-vue2-script-setup/vite'
import AutoImport from 'unplugin-auto-import/vite'
const root = path.resolve(__dirname, 'src')
const outDir = path.resolve(__dirname, 'dist')
const config = defineConfig({
// root,
resolve: {
alias: {
'@': `${path.resolve(__dirname, 'src')}`,
},
dedupe: ['vue-demi'],
},
build: {
// outDir,
minify: true,
rollupOptions: {
input: {
main: path.resolve(__dirname, 'index.html'),
about: path.resolve(__dirname, 'about', 'index.html'),
},
},
},
plugins: [
Vue2(),
ScriptSetup(),
WindiCSS(),
Components({
resolvers: [
IconsResolver({
componentPrefix: '',
}),
],
dts: 'src/components.d.ts',
}),
Icons(),
AutoImport({
imports: ['@vue/composition-api', 'vue-router', '@vueuse/core'],
dts: 'src/auto-imports.d.ts',
}),
],
server: {
port: 3333,
},
})
export default config
open about
path :http://localhost:3333/about
it is 404.
How can i fix it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.