mirror of
https://github.com/datahub-project/datahub.git
synced 2025-06-27 05:03:31 +00:00

* feat(react-images): host platform images on datahub-web-react * feat(react-images): update data_platforms logoUrl * feat(react-images): add explanation for CopyWebpackPlugin Co-authored-by: Amanda Ng <amanda.ng@grabtaxi.com>
37 lines
1.0 KiB
JavaScript
37 lines
1.0 KiB
JavaScript
require('dotenv').config();
|
|
const CracoAntDesignPlugin = require('craco-antd');
|
|
const path = require('path');
|
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
|
|
const themeConfig = require(`./src/conf/theme/${process.env.REACT_APP_THEME_CONFIG}`);
|
|
|
|
function addLessPrefixToKeys(styles) {
|
|
const output = {};
|
|
Object.keys(styles).forEach((key) => {
|
|
output[`@${key}`] = styles[key];
|
|
});
|
|
return output;
|
|
}
|
|
|
|
module.exports = {
|
|
webpack: {
|
|
plugins: {
|
|
add: [
|
|
// Self host images by copying them to the build directory
|
|
new CopyWebpackPlugin({
|
|
patterns: [{ from: 'src/images', to: 'platforms' }],
|
|
}),
|
|
],
|
|
},
|
|
},
|
|
plugins: [
|
|
{
|
|
plugin: CracoAntDesignPlugin,
|
|
options: {
|
|
customizeThemeLessPath: path.join(__dirname, 'src/conf/theme/global-variables.less'),
|
|
customizeTheme: addLessPrefixToKeys(themeConfig.styles),
|
|
},
|
|
},
|
|
],
|
|
};
|