build web-components suit for both vue and react.
build web-component which could work both for react and vue
-
lit Lit is a simple library for building fast, lightweight web components.
-
@webcomponents/webcomponentsjs polyfills supporting the Web Components
✔️ works for both create-react-app && nuxtjs
import { SimpleGreeting } from 'lit-web-components';
see vite#1579
import css with js just like import { Button } from 'element-ui
. plugin check https://github.com/ElementUI/babel-plugin-component
Converts
import { Button } from 'components'
to
var button = require('components/lib/button')
require('components/lib/button/style.css')
- 使用文档,create-react-app & nuxtjs
- 单元测试
- choose jest or vitest
- 集成测试
- playwright or cypress
- vite
lit/decorators.js
optimizeDeps:optimizeDeps: { exclude: ['lit'], }