NiPlayer
V1.4.3
RSPACK + SOLID-JS + SOLID-STORE + PNPM + MONOREPOを使用したリファクタリング。
プレーヤーの全体的な構造は、プレーヤーレイヤー、ストアレイヤー、プラグインレイヤーに分割されます。
tsconfig.json experiment experimentAldeCoratorsをtrueに構成します
{
"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はReactのReact.Createlement(JSXタイプのプロンプトにも見られるReact/JSX-Runtimeを含む)を使用してVDOMをコンパイルします。したがって、Solid-JS + TSXの組み合わせを使用する場合は、それぞれtsconfig.jsonとrspack.config.cjsで特別な構成を実行する必要があります。
tsconfig.json
{
"compilerOptions" : {
"jsx" : "preserve" ,
"jsxImportSource" : "solid-js" ,
"module" : "ESNext" ,
"moduleResolution" : "Bundler"
}
}rspack.config.cjsは、次のようにbabel-roaderを構成します。
全体的な編集プロセス: