Git Product home page Git Product logo

convue's Introduction

convue

convue is a plugin for vite based on vite and vue3 that gives you a set of experiences for rapid development projects, similar to nuxt and umi.js.Reference documents:https://ziping-li.github.io/convue/.

Motivation and advantages

  1. umi.js does not support vue at the moment, and nuxt does not yet have perfect support for vue3 and vite.
  2. convue is a plugin for vite, which is closer to the official vue base ecosystem and can integrate perfectly with other base libraries.
  3. convue is only a development dependency, compared to other frameworks, the size of the build is almost 0.

Quick start

  1. install convue.
yarn add convue -D
  1. Use it in your project

Use it in vite.config.js

import convue from 'convue';

export default defineConfig({
  plugins: [
    ...convue({}),
  ],
});
  1. Introduce the required packages in main.js, or leave them out if you don't need them
import { createApp } from 'vue';
import App from '. /src/App.vue';
import router from 'pages-generated';
import globalComponent from 'components-generated';
import store from 'store-generated';
import plugin from 'plugin-generated';
import i18n from 'locale-generated';

const app = createApp(App);
window.__APP__ = app; // To allow middleware to get the component instance, remove the line if you don't need to use it

app.use(router);
app.use(globalComponent);
app.use(store);
app.use(plugin);
app.use(i18n);
app.mount('#app');

Using convue-cli

convue provides a set of scaffolding tools for initializing projects, currently supporting both sfc (vue single file) and tsx development modes.

# step 1
yarn global add convue-cli
# step 2 - type convue on the command line, followed by a prompt to do
convue
# step 3 - enter the project file
npm run dev

Project directory

convue uses an agreed-upon directory format, so we need to follow this development style. It is often an effective measure to achieve uniformity and efficiency in a project.

If you need to change the directory structure, you can refer to the configuration item.

Take the tsx form as an example.

├── public
├── src
    ├─ components
    ├── layouts
        ├─ default.tsx
    ├─ locales
        ├─ en-US.ts
        ├── zh-CN.ts
    ├─ middleware
    ├── pages
        └── index.tsx
    ├─ plugins
    ├─ store
    └── App.tsx
├── .babelrc
├── .eslintrc.js
├── .gitignore
├── .prettierrc
├─ .stylelintrc.json
├── index.html
├─ package.json
├─ shims.d.ts
├─ tsconfig.json
├─ vite.config.ts
├── yarn.lock

convue's People

Contributors

ziping-li avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.