-
Notifications
You must be signed in to change notification settings - Fork 164
Expand file tree
/
Copy pathrslib.config.ts
More file actions
119 lines (117 loc) · 2.18 KB
/
Copy pathrslib.config.ts
File metadata and controls
119 lines (117 loc) · 2.18 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
import path from 'node:path';
import { pluginLess } from '@rsbuild/plugin-less';
import { pluginReact } from '@rsbuild/plugin-react';
import { defineConfig } from '@rslib/core';
const bundlelessConfig = {
source: {
entry: {
index: ['./src/**', '!src/**/*.less'],
},
},
bundle: false,
dts: true,
redirect: {
style: {
extension: false,
},
},
output: {
copy: [{ from: '**/*.less', context: path.join(__dirname, 'src') }],
},
tools: {
rspack: {
module: {
rules: [
{
test: /\.(eot|ttf)$/,
type: 'asset/inline',
},
],
},
},
},
};
export default defineConfig({
lib: [
{
...bundlelessConfig,
format: 'esm',
output: {
...bundlelessConfig.output,
distPath: {
root: './esm',
},
},
},
{
...bundlelessConfig,
format: 'cjs',
output: {
...bundlelessConfig.output,
distPath: {
root: './cjs',
},
},
},
{
bundle: true,
dts: false,
format: 'umd',
umdName: 'ReactMarkdownEditorLite',
source: {
entry: {
index: ['src/index.ts', 'src/index.less'],
},
},
output: {
externals: {
react: {
root: 'React',
amd: 'react',
commonjs: 'react',
commonjs2: 'react',
},
},
distPath: {
root: './lib',
},
minify: true,
emitCss: true,
overrideBrowserslist: [
'defaults',
'not ie < 11',
'last 2 versions',
'> 0.2%',
'iOS 7',
'last 3 iOS versions',
],
},
tools: {
rspack: {
resolve: {
symlinks: false,
},
module: {
rules: [
{
test: /\.(eot|ttf)$/,
type: 'asset/inline',
},
],
},
},
},
},
],
output: {
target: 'web',
},
plugins: [
pluginReact({
swcReactOptions: {
runtime: 'classic',
},
}),
pluginLess(),
],
});