(feature)(supersonic-fe) add chat external route (#1407)

This commit is contained in:
williamhliu
2024-07-15 10:10:50 +08:00
committed by GitHub
parent 529251097b
commit 4d1360b924
2 changed files with 18 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
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 = {
...basicConfig, ...basicConfig,
@@ -11,22 +11,20 @@ const config = {
format: 'umd', format: 'umd',
exports: 'named', exports: 'named',
globals: { globals: {
'react': 'React', react: 'React',
'react-dom': 'ReactDOM', 'react-dom': 'ReactDOM',
'axios': 'Axios' axios: 'Axios',
}, },
plugins: [ plugins: [terser()],
terser()
],
}, },
], ],
plugins: [ plugins: [
replace({ replace({
'process.env.NODE_ENV': JSON.stringify('production'), 'process.env.NODE_ENV': JSON.stringify('production'),
}), }),
...basicConfig.plugins ...basicConfig.plugins,
], ],
external: ['react', 'react-dom', 'axios'] external: ['react', 'react-dom', 'axios'],
} };
export default config export default config;

View File

@@ -16,6 +16,14 @@ const ROUTES = [
layout: false, layout: false,
envEnableList: [ENV_KEY.CHAT], envEnableList: [ENV_KEY.CHAT],
}, },
{
path: '/chat/external',
name: 'chat',
component: './ChatPage',
hideInMenu: true,
layout: false,
envEnableList: [ENV_KEY.CHAT],
},
{ {
path: '/chat', path: '/chat',
name: 'chat', name: 'chat',