ttrpg-tools/rsbuild.config.ts

44 lines
887 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { defineConfig } from '@rsbuild/core';
import { pluginBabel } from '@rsbuild/plugin-babel';
import { pluginSolid } from '@rsbuild/plugin-solid';
import tailwindcss from '@tailwindcss/postcss';
export default defineConfig({
plugins: [
pluginBabel({
include: /\.(?:jsx|tsx)$/,
}),
pluginSolid(),
],
tools: {
postcss: {
postcssOptions: {
plugins: [tailwindcss()],
},
},
bundlerChain: (chain) => {
// 为 .md 文件配置 raw-loader支持 webpackContext 加载
chain.module
.rule('md-raw')
.test(/\.md$/)
.type('asset/source');
},
},
html: {
template: './src/index.html',
},
source: {
entry: {
index: './src/main.tsx',
},
},
output: {
distPath: {
root: 'dist/web',
},
copy: [
{ from: './content', to: 'content' },
],
},
});