Giter Club home page Giter Club logo

vue3-component-demo's Introduction

前端组件库

monorepo + typescript + tsx + vitest + pnpm + eslint + husky + 自动部署 + vuepress@next

es // button import es6 按需加载 vite tree shaking lib // ssr lib commonjs dist // cdn bundle

git commit -am "update"

feat: 新特性或者新功能

fix: 修复 bug

chore: 构建过程或者其他无关的改动

refactor: 重构

ci: 持续集成,自动部署

wx: aibayanyu2022

vue3-component-demo's People

Contributors

aibayanyu20 avatar vinomamba avatar

Stargazers

柯灰 avatar  avatar Vimalakirti avatar zepeng avatar Thawne avatar Leo Stamford avatar  avatar  avatar  avatar  avatar Alicevia avatar Stitch avatar  avatar

vue3-component-demo's Issues

引入vuepress-plugin-code-block无效果

package.json

{
  "name": "site",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "dev": "vuepress dev",
    "build": "vuepress build",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "vuepress": "^2.0.0-beta.39"
  },
  "devDependencies": {
    "@vitejs/plugin-vue-jsx": "^1.3.9",
    "@vuepress/client": "^2.0.0-beta.38",
    "@yanyu-fe/vuepress-plugin-code-block": "^0.0.14"
  }
}

config.ts

import { defineUserConfig } from 'vuepress'
import type { DefaultThemeOptions, ViteBundlerOptions } from 'vuepress'
import * as navbar from './configs/navbar'
import * as sidebar from './configs/sidebar'
import vueJsx from '@vitejs/plugin-vue-jsx'
import { resolve } from 'path'

// TODO TS报错defineUserConfig不能加类型
export default defineUserConfig<DefaultThemeOptions, ViteBundlerOptions>({
  title: '前端组件库',
  plugins: [['@yanyu-fe/vuepress-plugin-code-block', {}]],
  locales: {
    '/': {
      lang: 'zh-CN',
      title: 'ui-design'
    }
  },
  lang: 'zh-CN',
  themeConfig: {
    locales: {
      '/': {
        navbar: navbar.zh,
        sidebar: sidebar.zh
      }
    }
  },
  bundlerConfig: {
    viteOptions: {
      plugins: [vueJsx()],
      resolve: {
        alias: {
          'ui-design': resolve(__dirname, '../../packages/ui/src/index.ts')
        }
      }
    }
  }
})

  1. TS报错defineUserConfig不能加类型,defineUserConfig没有给泛型
  2. @yanyu-fe/vuepress-plugin-code-block 使用不了,原因是不能将类型“string”分配给类型“Plugin”

打包生成 css存在的问题

按照 packages/ui/vite.config.style.ts 打包出来的 css.js 文件引入存在问题

css.js

image

src/button/style/index.ts

image

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.