ttrpg-tools/rsbuild.config.ts

44 lines
900 B
TypeScript
Raw Normal View History

2026-02-26 00:17:23 +08:00
import { defineConfig } from '@rsbuild/core';
2026-02-26 00:27:38 +08:00
import { pluginBabel } from '@rsbuild/plugin-babel';
2026-02-26 00:17:23 +08:00
import { pluginSolid } from '@rsbuild/plugin-solid';
2026-02-26 08:14:42 +08:00
import tailwindcss from '@tailwindcss/postcss';
2026-02-26 00:17:23 +08:00
export default defineConfig({
plugins: [
2026-02-26 00:27:38 +08:00
pluginBabel({
include: /\.(?:jsx|tsx)$/,
}),
2026-02-26 00:17:23 +08:00
pluginSolid(),
],
tools: {
2026-02-26 08:14:42 +08:00
postcss: {
postcssOptions: {
plugins: [tailwindcss()],
},
2026-02-26 00:17:23 +08:00
},
2026-02-26 14:40:02 +08:00
bundlerChain: (chain) => {
// 为 .md 文件配置 raw-loader支持 webpackContext 加载
chain.module
.rule('md-raw')
2026-03-13 15:52:51 +08:00
.test(/\.md|\.yarn|\.csv$/)
2026-02-26 14:40:02 +08:00
.type('asset/source');
},
2026-02-26 00:17:23 +08:00
},
html: {
template: './src/index.html',
},
source: {
entry: {
index: './src/main.tsx',
},
},
output: {
distPath: {
root: 'dist/web',
},
2026-02-26 00:40:11 +08:00
copy: [
{ from: './content', to: 'content' },
],
2026-02-26 00:17:23 +08:00
},
});