-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrspack.config.js
More file actions
47 lines (41 loc) · 1.23 KB
/
rspack.config.js
File metadata and controls
47 lines (41 loc) · 1.23 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
/* eslint-disable import/no-dynamic-require */
/* eslint-disable global-require */
const path = require('node:path');
const { merge } = require('webpack-merge');
const rspack = require('@rspack/core');
const getBaseConfiguration = require('@centreon/js-config/rspack/base');
const getModuleConfiguration = require('@centreon/js-config/rspack/patch/module');
const moduleFederationConfiguration = require('./moduleFederation.json');
const baseOutputPath = path.resolve(`${__dirname}/../static`);
const moduleConfiguration = getModuleConfiguration({
federatedComponentConfiguration: moduleFederationConfiguration,
outputPath: baseOutputPath
});
module.exports = (enableCoverage = false) => {
return merge(
getBaseConfiguration({
enableCoverage,
moduleFederationConfig: {
exposes: {
'./reactExample': './pages/reactExample/index'
}
},
moduleName: 'centreonDummyModule',
postCssBase: './'
}),
moduleConfiguration,
{
entry: {
'pages/reactExample/index': './pages/reactExample/index.tsx'
},
optimization: {
splitChunks: false
},
plugins: [
new rspack.ProvidePlugin({
React: 'react'
})
]
}
);
};