NiPlayer
V1.4.3
refactoring باستخدام RSPACK + Solid-JS + Solid Store + PNPM + Monorepo ؛
يتم تقسيم الهيكل العام للاعب إلى طبقة المشغل ، وطبقة المتجر ، وطبقة البرنامج المساعد ؛
tsconfig.json تكوين التجارب إلى True
{
"compilerOptions" : {
"target" : "ESNext" ,
"module" : "ES6" ,
"experimentalDecorators" : true
}
} RSPACK.CONFIG.CJS Babel-Loader Configuration **["@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 بتجميع VDOD باستخدام React's 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 على النحو التالي:
عملية التجميع العامة: