-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrsbuild.config.ts
50 lines (49 loc) · 1.41 KB
/
rsbuild.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { defineConfig } from '@rsbuild/core';
import { pluginReact } from '@rsbuild/plugin-react';
// @ts-ignore
import { buildInfo } from './src/default_data/buildInfo';
export default defineConfig({
plugins: [pluginReact()],
html: {
title: 'buyfakett - About Me',
meta: {
viewport: 'width=device-width, initial-scale=1.0',
author: 'buyfakett',
description: 'about me • buyfakett',
'time-zone': 'Asia/Shanghai',
'git-hash': buildInfo.gitHash,
'git-branch': buildInfo.gitBranch,
'commit-date': buildInfo.commitDate,
'commit-count': buildInfo.commitCount,
'build-time': buildInfo.buildTime,
},
},
source: {
entry: {
index: './src/index.jsx',
},
// 编译所有 JS 文件并排除 core-js
// include: [{ not: /[\\/]core-js[\\/]/ }],
tsconfigPath: './jsconfig.json',
include: [/\.md$/],
},
tools: {
bundlerChain: (chain) => {
chain.module.rule('markdown').test(/\.md$/).type('asset/source');
},
},
output: {
distPath: {
root: 'build',
},
inlineScripts({ size }) {
return size < 10 * 1000;
},
},
performance: {
chunkSplit: {
// 代码拆分
strategy: 'split-by-experience',
},
},
});