mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-12 12:37:55 +00:00
[improvement](webapp) change rollup terser package
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "supersonic-chat-sdk",
|
"name": "supersonic-chat-sdk",
|
||||||
"version": "0.1.6",
|
"version": "0.1.0",
|
||||||
"main": "dist/index.es.js",
|
"main": "dist/index.es.js",
|
||||||
"module": "dist/index.es.js",
|
"module": "dist/index.es.js",
|
||||||
"unpkg": "dist/index.umd.js",
|
"unpkg": "dist/index.umd.js",
|
||||||
@@ -63,6 +63,7 @@
|
|||||||
"@rollup/plugin-json": "^6.0.0",
|
"@rollup/plugin-json": "^6.0.0",
|
||||||
"@rollup/plugin-node-resolve": "^15.0.2",
|
"@rollup/plugin-node-resolve": "^15.0.2",
|
||||||
"@rollup/plugin-replace": "^5.0.2",
|
"@rollup/plugin-replace": "^5.0.2",
|
||||||
|
"@rollup/plugin-terser": "^0.4.3",
|
||||||
"@svgr/webpack": "^5.5.0",
|
"@svgr/webpack": "^5.5.0",
|
||||||
"@testing-library/jest-dom": "^5.16.5",
|
"@testing-library/jest-dom": "^5.16.5",
|
||||||
"@testing-library/react": "^13.4.0",
|
"@testing-library/react": "^13.4.0",
|
||||||
@@ -117,7 +118,6 @@
|
|||||||
"rollup-plugin-exclude-dependencies-from-bundle": "^1.1.23",
|
"rollup-plugin-exclude-dependencies-from-bundle": "^1.1.23",
|
||||||
"rollup-plugin-less": "^1.1.3",
|
"rollup-plugin-less": "^1.1.3",
|
||||||
"rollup-plugin-postcss": "^4.0.2",
|
"rollup-plugin-postcss": "^4.0.2",
|
||||||
"rollup-plugin-terser": "^7.0.2",
|
|
||||||
"rollup-plugin-typescript2": "^0.34.1",
|
"rollup-plugin-typescript2": "^0.34.1",
|
||||||
"sass-loader": "^12.3.0",
|
"sass-loader": "^12.3.0",
|
||||||
"semver": "^7.3.5",
|
"semver": "^7.3.5",
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import basicConfig from './rollup.config.mjs'
|
import basicConfig from './rollup.config.mjs'
|
||||||
// import { terser } from "rollup-plugin-terser"
|
|
||||||
import excludeDependenciesFromBundle from "rollup-plugin-exclude-dependencies-from-bundle"
|
import excludeDependenciesFromBundle from "rollup-plugin-exclude-dependencies-from-bundle"
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
@@ -8,9 +7,6 @@ const config = {
|
|||||||
{
|
{
|
||||||
file: 'dist/index.es.js',
|
file: 'dist/index.es.js',
|
||||||
format: 'es',
|
format: 'es',
|
||||||
// plugins: [
|
|
||||||
// terser()
|
|
||||||
// ],
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
plugins: [
|
plugins: [
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import basicConfig from './rollup.config.mjs'
|
import basicConfig from './rollup.config.mjs'
|
||||||
import { terser } from "rollup-plugin-terser"
|
import terser from '@rollup/plugin-terser';
|
||||||
import replace from '@rollup/plugin-replace'
|
import replace from '@rollup/plugin-replace'
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
"@antv/layout": "^0.3.20",
|
"@antv/layout": "^0.3.20",
|
||||||
"@antv/xflow": "^1.0.55",
|
"@antv/xflow": "^1.0.55",
|
||||||
"@babel/runtime": "^7.22.5",
|
"@babel/runtime": "^7.22.5",
|
||||||
"supersonic-chat-sdk": "^0.1.6",
|
"supersonic-chat-sdk": "^0.1.0",
|
||||||
"@types/numeral": "^2.0.2",
|
"@types/numeral": "^2.0.2",
|
||||||
"@types/react-draft-wysiwyg": "^1.13.2",
|
"@types/react-draft-wysiwyg": "^1.13.2",
|
||||||
"@types/react-syntax-highlighter": "^13.5.0",
|
"@types/react-syntax-highlighter": "^13.5.0",
|
||||||
@@ -137,7 +137,7 @@
|
|||||||
"typescript": "^4.0.3"
|
"typescript": "^4.0.3"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10.0.0"
|
"node": ">=10.0.0 <17.0.0"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"@types/react": "17.0.0"
|
"@types/react": "17.0.0"
|
||||||
|
|||||||
@@ -12,8 +12,6 @@ import defaultSettings from '../config/defaultSettings';
|
|||||||
import settings from '../config/themeSettings';
|
import settings from '../config/themeSettings';
|
||||||
import { deleteUrlQuery } from './utils/utils';
|
import { deleteUrlQuery } from './utils/utils';
|
||||||
import { AUTH_TOKEN_KEY, FROM_URL_KEY } from '@/common/constants';
|
import { AUTH_TOKEN_KEY, FROM_URL_KEY } from '@/common/constants';
|
||||||
import 'supersonic-chat-sdk/dist/index.css';
|
|
||||||
import { setToken as setChatSdkToken } from 'supersonic-chat-sdk';
|
|
||||||
export { request } from './services/request';
|
export { request } from './services/request';
|
||||||
import { ROUTE_AUTH_CODES } from '../config/routes';
|
import { ROUTE_AUTH_CODES } from '../config/routes';
|
||||||
|
|
||||||
@@ -98,8 +96,6 @@ export async function getInitialState(): Promise<{
|
|||||||
await getToken();
|
await getToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
setChatSdkToken(localStorage.getItem(AUTH_TOKEN_KEY) || '');
|
|
||||||
|
|
||||||
const currentUser = await fetchUserInfo();
|
const currentUser = await fetchUserInfo();
|
||||||
|
|
||||||
if (currentUser) {
|
if (currentUser) {
|
||||||
|
|||||||
@@ -10,9 +10,11 @@ import Conversation from './Conversation';
|
|||||||
import RightSection from './RightSection';
|
import RightSection from './RightSection';
|
||||||
import ChatFooter from './ChatFooter';
|
import ChatFooter from './ChatFooter';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { DEFAULT_CONVERSATION_NAME, WEB_TITLE } from '@/common/constants';
|
import { AUTH_TOKEN_KEY, DEFAULT_CONVERSATION_NAME, WEB_TITLE } from '@/common/constants';
|
||||||
import { HistoryMsgItemType, MsgDataType, getHistoryMsg, queryContext } from 'supersonic-chat-sdk';
|
import { HistoryMsgItemType, MsgDataType, getHistoryMsg, queryContext } from 'supersonic-chat-sdk';
|
||||||
import { getConversationContext } from './utils';
|
import { getConversationContext } from './utils';
|
||||||
|
import { setToken as setChatSdkToken } from 'supersonic-chat-sdk';
|
||||||
|
import 'supersonic-chat-sdk/dist/index.css';
|
||||||
|
|
||||||
const Chat = () => {
|
const Chat = () => {
|
||||||
const [messageList, setMessageList] = useState<MessageItem[]>([]);
|
const [messageList, setMessageList] = useState<MessageItem[]>([]);
|
||||||
@@ -27,6 +29,10 @@ const Chat = () => {
|
|||||||
const conversationRef = useRef<any>();
|
const conversationRef = useRef<any>();
|
||||||
const chatFooterRef = useRef<any>();
|
const chatFooterRef = useRef<any>();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setChatSdkToken(localStorage.getItem(AUTH_TOKEN_KEY) || '');
|
||||||
|
}, []);
|
||||||
|
|
||||||
const sendHelloRsp = () => {
|
const sendHelloRsp = () => {
|
||||||
setMessageList([
|
setMessageList([
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import { postUserLogin, userRegister } from './services';
|
|||||||
import { AUTH_TOKEN_KEY } from '@/common/constants';
|
import { AUTH_TOKEN_KEY } from '@/common/constants';
|
||||||
import { queryCurrentUser } from '@/services/user';
|
import { queryCurrentUser } from '@/services/user';
|
||||||
import { history, useModel } from 'umi';
|
import { history, useModel } from 'umi';
|
||||||
// import { setToken as setChatSdkToken } from 'supersonic-chat-sdk';
|
|
||||||
|
|
||||||
const { Item } = Form;
|
const { Item } = Form;
|
||||||
const LoginPage: React.FC = () => {
|
const LoginPage: React.FC = () => {
|
||||||
@@ -25,7 +24,6 @@ const LoginPage: React.FC = () => {
|
|||||||
const { code, data, msg } = await postUserLogin(values);
|
const { code, data, msg } = await postUserLogin(values);
|
||||||
if (code === 200) {
|
if (code === 200) {
|
||||||
localStorage.setItem(AUTH_TOKEN_KEY, data);
|
localStorage.setItem(AUTH_TOKEN_KEY, data);
|
||||||
// setChatSdkToken(data || '');
|
|
||||||
const { code: queryUserCode, data: queryUserData } = await queryCurrentUser();
|
const { code: queryUserCode, data: queryUserData } = await queryCurrentUser();
|
||||||
if (queryUserCode === 200) {
|
if (queryUserCode === 200) {
|
||||||
const currentUser = {
|
const currentUser = {
|
||||||
|
|||||||
Reference in New Issue
Block a user