@redhat-cloud-services/frontend-components-config 4.5.11 → 4.6.2
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/README.md +3 -0
- package/bin/fec.js +33 -2
- package/index.js +67 -63
- package/package.json +7 -2
- package/src/config.js +183 -177
- package/src/config.test.js +86 -109
- package/src/plugins.js +48 -54
- package/src/plugins.test.js +31 -35
- package/src/scripts/common.js +7 -0
- package/src/scripts/csc-interceptor-server.js +70 -0
- package/src/scripts/dev-script.js +102 -0
- package/src/scripts/dev.webpack.config.js +62 -0
- package/src/scripts/empty.js +2 -0
- package/src/scripts/prod.webpack.config.js +19 -0
- package/src/scripts/webpack.plugins.js +14 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const config = require('@redhat-cloud-services/frontend-components-config');
|
|
2
|
+
const commonPlugins = require('./webpack.plugins');
|
|
3
|
+
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
|
4
|
+
|
|
5
|
+
const { config: webpackConfig, plugins } = config({
|
|
6
|
+
rootFolder: process.env.FEC_ROOT_DIR || process.cwd(),
|
|
7
|
+
...(process.env.BETA === 'true' && { deployment: 'beta/apps' }),
|
|
8
|
+
});
|
|
9
|
+
plugins.push(...commonPlugins);
|
|
10
|
+
|
|
11
|
+
module.exports = (env) => {
|
|
12
|
+
if (env && env.analyze === 'true') {
|
|
13
|
+
plugins.push(new BundleAnalyzerPlugin());
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
...webpackConfig,
|
|
17
|
+
plugins,
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const webpack = require('webpack');
|
|
2
|
+
const { resolve } = require('path');
|
|
3
|
+
const fedModulePlugin = require('@redhat-cloud-services/frontend-components-config/federated-modules');
|
|
4
|
+
|
|
5
|
+
const rootDir = process.env.FEC_ROOT_DIR || process.cwd();
|
|
6
|
+
|
|
7
|
+
const plugins = [fedModulePlugin({ root: rootDir })];
|
|
8
|
+
|
|
9
|
+
// Save 20kb of bundle size in prod
|
|
10
|
+
if (process.env.NODE_ENV === 'production') {
|
|
11
|
+
plugins.push(new webpack.NormalModuleReplacementPlugin(/redux-logger/, resolve(__dirname, './empty.js')));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
module.exports = plugins;
|