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