@centreon/js-config 23.4.14 → 23.4.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/jest/index.js CHANGED
@@ -21,6 +21,6 @@ module.exports = {
21
21
  ],
22
22
  },
23
23
  transformIgnorePatterns: [
24
- '/node_modules/(?!centreon-frontend/packages/(centreon-ui|ui-context)).+\\.jsx?$',
24
+ '/node_modules/',
25
25
  ],
26
26
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@centreon/js-config",
3
3
  "description": "Centreon Frontend shared build configuration",
4
- "version": "23.4.14",
4
+ "version": "23.4.15",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/centreon/centreon-frontend.git"
@@ -3,6 +3,8 @@ const path = require('path');
3
3
  const { CleanWebpackPlugin } = require('clean-webpack-plugin');
4
4
  const { ModuleFederationPlugin } = require('webpack').container;
5
5
 
6
+ const excludeAllNodeModules = /node_modules/;
7
+
6
8
  const excludeNodeModulesExceptCentreonUi =
7
9
  /node_modules(\\|\/)\.pnpm(\\|\/)(?!(@centreon))/;
8
10
 
@@ -19,7 +21,7 @@ const getBaseConfiguration = ({
19
21
  test: /\.[cm]?(j|t)sx?$/
20
22
  },
21
23
  {
22
- exclude: excludeNodeModulesExceptCentreonUi,
24
+ exclude: excludeAllNodeModules,
23
25
  test: /\.[jt]sx?$/,
24
26
  use: {
25
27
  loader: 'swc-loader',
@@ -67,57 +69,58 @@ const getBaseConfiguration = ({
67
69
  },
68
70
  plugins: [
69
71
  new CleanWebpackPlugin(),
70
- new ModuleFederationPlugin({
71
- filename: 'remoteEntry.[chunkhash:8].js',
72
- library: { name: moduleName, type: 'var' },
73
- name: moduleName,
74
- shared: [
75
- {
76
- '@centreon/ui-context': {
77
- requiredVersion: '22.10.0',
78
- singleton: true
79
- }
80
- },
81
- {
82
- jotai: {
83
- requiredVersion: '1.x',
84
- singleton: true
85
- }
86
- },
87
- {
88
- 'jotai-suspense': {
89
- requiredVersion: '0.1.x',
90
- singleton: true
91
- }
92
- },
93
- {
94
- react: {
95
- requiredVersion: '18.x',
96
- singleton: true
97
- }
98
- },
99
- {
100
- 'react-dom': {
101
- requiredVersion: '18.x',
102
- singleton: true
103
- }
104
- },
105
- {
106
- 'react-i18next': {
107
- requiredVersion: '11.x',
108
- singleton: true
109
- }
110
- },
111
- {
112
- 'react-router-dom': {
113
- requiredVersion: '6.x',
114
- singleton: true
72
+ moduleName &&
73
+ new ModuleFederationPlugin({
74
+ filename: 'remoteEntry.[chunkhash:8].js',
75
+ library: { name: moduleName, type: 'var' },
76
+ name: moduleName,
77
+ shared: [
78
+ {
79
+ '@centreon/ui-context': {
80
+ requiredVersion: '22.10.0',
81
+ singleton: true
82
+ }
83
+ },
84
+ {
85
+ jotai: {
86
+ requiredVersion: '1.x',
87
+ singleton: true
88
+ }
89
+ },
90
+ {
91
+ 'jotai-suspense': {
92
+ requiredVersion: '0.1.x',
93
+ singleton: true
94
+ }
95
+ },
96
+ {
97
+ react: {
98
+ requiredVersion: '18.x',
99
+ singleton: true
100
+ }
101
+ },
102
+ {
103
+ 'react-dom': {
104
+ requiredVersion: '18.x',
105
+ singleton: true
106
+ }
107
+ },
108
+ {
109
+ 'react-i18next': {
110
+ requiredVersion: '11.x',
111
+ singleton: true
112
+ }
113
+ },
114
+ {
115
+ 'react-router-dom': {
116
+ requiredVersion: '6.x',
117
+ singleton: true
118
+ }
115
119
  }
116
- }
117
- ],
118
- ...moduleFederationConfig
119
- })
120
- ],
120
+ ],
121
+ ...moduleFederationConfig
122
+ })
123
+ ].filter(Boolean),
121
124
  resolve: {
122
125
  alias: {
123
126
  react: path.resolve('./node_modules/react')