44 lines
887 B
TypeScript
44 lines
887 B
TypeScript
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' },
|
||
],
|
||
},
|
||
});
|