NiPlayer
V1.4.3
refactoring โดยใช้ RSPACK + SOLID-JS + SOLID-STORE + PNPM + MONOREPO;
โครงสร้างโดยรวมของผู้เล่นแบ่งออกเป็นเลเยอร์ผู้เล่นชั้นเก็บและเลเยอร์ปลั๊กอิน
tsconfig.json กำหนดค่าการทดลองใช้เป็นจริง
{
"compilerOptions" : {
"target" : "ESNext" ,
"module" : "ES6" ,
"experimentalDecorators" : true
}
} rspack.config.cjs การกำหนดค่าปลั๊กอิน babel-loader **["@babel/plugin-proposal-decorators", { "legacy": true}] ]**
// @ts-check
const { defineConfig } = require ( '@rspack/cli' ) ;
const path = require ( 'path' ) ;
const config = defineConfig ( {
module : {
rules : [
{
test : / .(j|t)sx?$ / ,
use : [
{
loader : 'babel-loader' ,
options : {
presets : [ 'solid' , '@babel/preset-typescript' ] ,
plugins : [ 'solid-styled-jsx/babel' , [ "@babel/plugin-proposal-decorators" , { "legacy" : true } ] ]
} ,
} ,
] ,
}
]
}
} ) ;โดยค่าเริ่มต้น TSX จะรวบรวม VDOM โดยใช้ React.createlement (รวมถึง React/JSX-Runtime ที่พบได้สำหรับการแจ้งประเภท JSX); ดังนั้นหากคุณต้องการใช้การรวมกันของ SOLID-JS + TSX คุณจะต้องทำการกำหนดค่าพิเศษใน tsconfig.json และ rspack.config.cjs ตามลำดับ:
tsconfig.json
{
"compilerOptions" : {
"jsx" : "preserve" ,
"jsxImportSource" : "solid-js" ,
"module" : "ESNext" ,
"moduleResolution" : "Bundler"
}
}rspack.config.cjs กำหนดค่า babel-loader ดังนี้:
กระบวนการรวบรวมโดยรวม: