Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add web-components #36

Merged
merged 14 commits into from
Dec 4, 2023
Prev Previous commit
Next Next commit
update:add vite.config.ts proxy;remove empty line
  • Loading branch information
zreren committed Dec 1, 2023
commit f425c677c1613b23e23606395bd2f05dac47d658
1 change: 0 additions & 1 deletion webcomponents/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference path="./types/components.d.ts" />

import './style/index.css'
import "./model/joy-rtc"
import JoyRtcComponent from './model/joy-rtc';
Expand Down
2 changes: 0 additions & 2 deletions webcomponents/types/components.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import JoyRtcComponent from '../model/joy-rtc'



type CustomElement<T extends HTMLElement> = Partial<T & { children?: any } & { style?: any }>;

declare global {
Expand Down
10 changes: 9 additions & 1 deletion webcomponents/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,20 @@ export default defineConfig({
minify: 'terser',
sourcemap: true,
lib: {
entry: resolve(__dirname, "index.ts"), // 配置入口文件路径
entry: "index.ts", // 配置入口文件路径
name: "@joyrtc/webcomponents",
fileName: "index",
formats: ["es", "umd"], // 打包生成的格式
},
},
server: {
proxy: {
'^.*/socket': {
target: 'ws://localhost:8080',
ws: true,
},
},
},
plugins: [dts(),cssInjectedByJsPlugin()]
});