-
Notifications
You must be signed in to change notification settings - Fork 2
/
modern.config.ts
81 lines (79 loc) · 1.74 KB
/
modern.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
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
import {
type PartialBaseBuildConfig,
defineConfig,
moduleTools,
} from '@modern-js/module-tools';
const sharedConfig: PartialBaseBuildConfig = {
format: 'esm',
target: 'es6',
buildType: 'bundle',
autoExternal: false,
platform: 'browser',
dts: false,
externals: ['react', 'react-dom', 'react/jsx-runtime', 'framer-motion'],
banner: {
js: `import './index.css';`,
},
};
export default defineConfig({
plugins: [moduleTools()],
buildConfig: [
{
...sharedConfig,
input: ['./src/nav-icon/index.tsx'],
outDir: './dist/nav-icon',
},
{
...sharedConfig,
input: ['./src/benchmark/index.tsx'],
outDir: './dist/benchmark',
},
{
...sharedConfig,
input: ['./src/tool-stack/index.tsx'],
outDir: './dist/tool-stack',
},
{
...sharedConfig,
input: ['./src/hero/index.tsx'],
outDir: './dist/hero',
},
{
...sharedConfig,
input: ['./src/section-style/index.tsx'],
outDir: './dist/section-style',
},
{
...sharedConfig,
input: ['./src/fully-featured/index.tsx'],
outDir: './dist/fully-featured',
},
{
...sharedConfig,
input: ['./src/built-with-rspack/index.tsx'],
outDir: './dist/built-with-rspack',
},
{
...sharedConfig,
input: ['./src/why-rspack/index.tsx'],
outDir: './dist/why-rspack',
},
{
...sharedConfig,
input: ['./src/background-image/index.tsx'],
outDir: './dist/background-image',
},
{
...sharedConfig,
input: ['./src/announcement/index.tsx'],
outDir: './dist/announcement',
},
{
buildType: 'bundleless',
outDir: './dist',
dts: {
only: true,
},
},
],
});