-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfarm.config.ts
48 lines (47 loc) · 1.23 KB
/
farm.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
import { resolve } from 'node:path';
import { defineConfig } from '@farmfe/core';
import farmJsPluginLess from '@farmfe/js-plugin-less';
import farmJsPluginSvgr from '@farmfe/js-plugin-svgr';
export default defineConfig(async (env) => {
return {
compilation: {
input: {
index: './index.farm.html'
},
progress: false,
presetEnv: false,
resolve: {
symlinks: true,
alias: {
'@': resolve(process.cwd(), './src'),
// 'react-dom': resolve(process.cwd(), './node_modules/react-dom'),
// react: resolve(process.cwd(), './node_modules/react')
}
},
output: {
path: './build',
filename: 'assets/[resourceName].[contentHash].[ext]',
assetsFilename: 'static/[resourceName].[contentHash].[ext]'
},
partialBundling: {
targetMinSize: 1024 * 2
},
},
server: {
cors: true,
port: 6260
},
plugins: [
[
'@farmfe/plugin-react',
{
refresh: process.env.NODE_ENV === 'development',
development: process.env.NODE_ENV === 'development',
runtime: 'automatic'
}
],
farmJsPluginLess(),
farmJsPluginSvgr()
]
};
});