-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathemp.config.ts
More file actions
104 lines (103 loc) · 2.45 KB
/
emp.config.ts
File metadata and controls
104 lines (103 loc) · 2.45 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
import { defineConfig } from '@empjs/cli';
import pluginReact from '@empjs/plugin-react';
import pluginTailwindcss from '@empjs/plugin-tailwindcss3';
export default defineConfig({
name: 'swcstudio-marketing',
server: {
port: 8080,
open: true,
},
html: {
title: 'SWC Studio Marketing - Powered by EMP',
},
resolve: {
alias: {
'@': './src',
'@shared': './shared/src',
'@components': './shared/src/components',
'@hooks': './shared/src/hooks',
'@integrations': './shared/src/integrations',
},
},
empShare: {
name: 'swcstudio_marketing',
exposes: {
'./App': './src/App.tsx',
'./components': './shared/src/components/index.ts',
'./hooks': './shared/src/hooks/index.ts',
'./design-system': './shared/src/design-system/index.ts',
'./integrations': './shared/src/integrations/index.ts',
},
shared: {
react: {
singleton: true,
requiredVersion: '^19.0.0',
},
'react-dom': {
singleton: true,
requiredVersion: '^19.0.0',
},
'@tanstack/react-query': {
singleton: true,
},
'@tanstack/react-router': {
singleton: true,
},
zustand: {
singleton: true,
},
'@arco-design/web-react': {
singleton: true,
},
},
remotes: {
// Add remote micro-frontends here
// Example:
// 'header': 'header@http://localhost:8001/emp.js',
// 'footer': 'footer@http://localhost:8002/emp.js'
},
},
plugins: [pluginReact(), pluginTailwindcss()],
experiments: {
css: true,
},
// TypeScript and CSS Modules support
typescript: {
typeCheck: true,
cssModuleTypeGeneration: true,
},
// Performance optimizations
optimization: {
splitChunks: {
chunks: 'all',
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name: 'vendors',
priority: 10,
},
react: {
test: /[\\/]node_modules[\\/](react|react-dom)[\\/]/,
name: 'react-vendor',
priority: 20,
},
shared: {
test: /[\\/]shared[\\/]/,
name: 'shared-components',
priority: 15,
},
},
},
treeshaking: true,
usedExports: true,
sideEffects: false,
},
// Development features
debug: {
clearLog: false,
level: 'info',
rsDoctor: {
enable: process.env.NODE_ENV === 'development',
},
},
});