debian-image-builder-frontend/config/dev.webpack.config.js
Sanne Raymaekers 2b4516856f config: Use beta deployments
Since our app is deployed under `/beta/insights`, we need to serve the
local files under `/beta` as well. This way we can use the production
chrome and services config.
2021-08-08 15:20:37 +03:00

33 lines
997 B
JavaScript

const { DefinePlugin } = require('webpack');
const { resolve } = require('path');
const { GitRevisionPlugin } = require('git-revision-webpack-plugin');
const config = require('@redhat-cloud-services/frontend-components-config');
const { config: webpackConfig, plugins } = config({
rootFolder: resolve(__dirname, '../'),
debug: true,
port: 8002,
useFileHash: false,
modules: [ 'image_builder' ],
sassPrefix: '.image-builder, body',
...(process.env.BETA && { deployment: 'beta/apps' }),
});
plugins.push(
require('@redhat-cloud-services/frontend-components-config/federated-modules')({
root: resolve(__dirname, '../'),
useFileHash: false,
moduleName: 'image_builder',
exposes: {
'./RootApp': resolve(__dirname, '../src/AppEntry.js'),
},
})
);
plugins.push(new DefinePlugin({
COMMITHASH: JSON.stringify((new GitRevisionPlugin()).commithash()),
}));
module.exports = {
...webpackConfig,
plugins
};