mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-22 22:30:52 +01:00
Update more things
This commit is contained in:
parent
e1cc0cd8c5
commit
029181ee04
@ -22,7 +22,7 @@
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root" class="w-100 h-100"></div>
|
||||
<script>
|
||||
const NitroConfig = {
|
||||
window.NitroConfig = {
|
||||
"config.urls": [ '/renderer-config.json', '/ui-config.json' ],
|
||||
"socket.url": (new URLSearchParams(window.location.search).get('socket.url') || null),
|
||||
"sso.ticket": (new URLSearchParams(window.location.search).get('sso') || null),
|
||||
|
@ -20,15 +20,15 @@ export const App: FC<{}> = props =>
|
||||
{
|
||||
try
|
||||
{
|
||||
//@ts-ignore
|
||||
if(!NitroConfig) throw new Error('NitroConfig is not defined!');
|
||||
if(!window.NitroConfig) throw new Error('NitroConfig is not defined!');
|
||||
|
||||
const renderer = await PrepareRenderer({
|
||||
width,
|
||||
height,
|
||||
autoDensity: true,
|
||||
backgroundAlpha: 0,
|
||||
preference: 'webgl'
|
||||
preference: 'webgl',
|
||||
resolution: window.devicePixelRatio
|
||||
});
|
||||
|
||||
GetTicker().add(ticker => renderer.render(GetStage()));
|
||||
|
@ -13,6 +13,7 @@ export default defineConfig({
|
||||
},
|
||||
build: {
|
||||
assetsInlineLimit: 102400,
|
||||
chunkSizeWarningLimit: 200000,
|
||||
rollupOptions: {
|
||||
output: {
|
||||
assetFileNames: 'src/assets/[name].[ext]',
|
||||
@ -20,7 +21,6 @@ export default defineConfig({
|
||||
{
|
||||
if(id.includes('node_modules'))
|
||||
{
|
||||
if(id.includes('pixi.js')) return 'pixi.js';
|
||||
if(id.includes('@nitrots/nitro-renderer')) return 'nitro-renderer';
|
||||
|
||||
return 'vendor';
|
||||
|
Loading…
Reference in New Issue
Block a user