pages235/renderer/rsbuild.config.ts
Vitaly 65af9a73c2
feat: rework hand! enable by default, fix bow anim (#261)
* refactor swing animation to controller

* idle animator!!!!

* implelment state switch transition

* a huge fix for UI server edit!

* adjust ui scaling so main menu elements clip less

* view bobbing, new config name, ws:

* EXTREMELY important fixes to entities rendering

* a lot of fixes, add dns resolve fallback

* improve f3 E, fix modal not found edge case

* set correctly target for old browsers, should fix ios 14 crash

* unecessary big refactor, to fix ts err

* fix isWysiwyg check

* fix entities rendering count
2025-02-15 05:14:36 +03:00

59 lines
2.1 KiB
TypeScript

import { defineConfig, mergeRsbuildConfig, RsbuildPluginAPI } from '@rsbuild/core';
import supportedVersions from '../src/supportedVersions.mjs'
import childProcess from 'child_process'
import path, { dirname, join } from 'path'
import { pluginReact } from '@rsbuild/plugin-react';
import { pluginNodePolyfill } from '@rsbuild/plugin-node-polyfill';
import fs from 'fs'
import fsExtra from 'fs-extra'
import { appAndRendererSharedConfig, rspackViewerConfig } from './rsbuildSharedConfig';
const mcDataPath = join(__dirname, '../generated/minecraft-data-optimized.json')
// if (!fs.existsSync('./playground/textures')) {
// fsExtra.copySync('node_modules/mc-assets/dist/other-textures/latest/entity', './playground/textures/entity')
// }
if (!fs.existsSync(mcDataPath)) {
childProcess.execSync('tsx ./scripts/makeOptimizedMcData.mjs', { stdio: 'inherit', cwd: path.join(__dirname, '..') })
}
export default mergeRsbuildConfig(
appAndRendererSharedConfig(),
defineConfig({
html: {
template: join(__dirname, './playground.html'),
},
output: {
cleanDistPath: false,
distPath: {
root: join(__dirname, './dist'),
},
},
server: {
port: 9090,
},
source: {
entry: {
index: join(__dirname, './playground/playground.ts')
},
define: {
'globalThis.includedVersions': JSON.stringify(supportedVersions),
},
},
plugins: [
{
name: 'test',
setup (build: RsbuildPluginAPI) {
const prep = async () => {
fsExtra.copySync(join(__dirname, '../node_modules/mc-assets/dist/other-textures/latest/entity'), join(__dirname, './dist/textures/entity'))
}
build.onBeforeBuild(async () => {
await prep()
})
build.onBeforeStartDevServer(() => prep())
},
},
],
})
)