-
Notifications
You must be signed in to change notification settings - Fork 1
/
craco.config.js
47 lines (45 loc) · 1.43 KB
/
craco.config.js
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
// this file contains the configuration for the craco project
// Usage in file craco.config.js:
// module.exports = require('@iobroker/vis-2-widgets-react-dev/craco.config.js');
const { ProvidePlugin } = require('webpack');
const cracoModuleFederation = require('./craco-module-federation'); // use a local patched version
module.exports = {
plugins: [
// { plugin: CracoEsbuildPlugin },
{
plugin: cracoModuleFederation,
options: { useNamedChunkIds: true },
}
],
devServer: {
proxy: {
'/_socket': 'http://localhost:8082',
'/vis.0': 'http://localhost:8082',
'/adapter': 'http://localhost:8082',
'/habpanel': 'http://localhost:8082',
'/vis': 'http://localhost:8082',
'/widgets': 'http://localhost:8082/vis',
'/widgets.html': 'http://localhost:8082/vis',
'/web': 'http://localhost:8082',
'/state': 'http://localhost:8082',
},
},
webpack: {
entry: './src/index.ts',
resolve: {
extensions: ['.tsx', '.ts', '.js', '.jsx'],
},
output: {
publicPath: 'auto',
},
plugins: [
new ProvidePlugin({
React: 'react',
}),
],
configure: webpackConfig => {
webpackConfig.output.publicPath = 'auto';
return webpackConfig;
},
},
};