debian-image-builder-frontend/config/dev.webpack.config.js
Sanne Raymaekers 3207afce90
config: remove module name in webpack config (#959)
Due to merging the openshift and chrome plugin systems there's
additional requirements on the format of the module name.

Camelcase is the default, so the values can just be removed from the
config.
2023-02-09 12:17:27 +01:00

50 lines
1.3 KiB
JavaScript

const { resolve } = require('path');
const config = require('@redhat-cloud-services/frontend-components-config');
const { GitRevisionPlugin } = require('git-revision-webpack-plugin');
const { DefinePlugin } = require('webpack');
const webpackProxy = {
useProxy: true,
proxyVerbose: true,
env: `${process.env.STAGE ? 'stage' : 'prod'}-${
process.env.BETA ? 'beta' : 'stable'
}`,
appUrl: process.env.BETA
? '/beta/insights/image-builder'
: '/insights/image-builder',
};
const { config: webpackConfig, plugins } = config({
rootFolder: resolve(__dirname, '../'),
debug: true,
useFileHash: false,
sassPrefix: '.imageBuilder',
deployment: process.env.BETA ? 'beta/apps' : 'apps',
...(process.env.PROXY ? webpackProxy : {}),
});
plugins.push(
require('@redhat-cloud-services/frontend-components-config/federated-modules')(
{
root: resolve(__dirname, '../'),
useFileHash: false,
exposes: {
'./RootApp': resolve(__dirname, '../src/AppEntry.js'),
},
shared: [{ 'react-router-dom': { singleton: true } }],
exclude: ['react-router-dom'],
}
)
);
plugins.push(
new DefinePlugin({
COMMITHASH: JSON.stringify(new GitRevisionPlugin().commithash()),
})
);
module.exports = {
...webpackConfig,
plugins,
};