refactor: add inline-schema

This commit is contained in:
hyper
2026-03-31 15:40:06 +08:00
parent 0aaf81057a
commit eb1388c6bc
3 changed files with 140 additions and 111 deletions
+15 -7
View File
@@ -16,13 +16,21 @@ export default defineConfig({
plugins: [tailwindcss()],
},
},
bundlerChain: (chain) => {
// 为 .md 文件配置 raw-loader,支持 webpackContext 加载
chain.module
.rule('md-raw')
.test(/\.md|\.yarn|\.csv$/)
.type('asset/source');
},
rspack: {
module: {
rules: [
{
test: /\.schema\.csv$/,
loader: 'inline-schema/csv-loader'
},
{
test: /\.md|\.yarn|\.csv$/,
exclude: /\.schema\.csv$/,
type: 'asset/source'
},
]
}
}
},
html: {
template: './src/index.html',