web-base/react/admin-panel/config-overrides.js

27 lines
711 B
JavaScript
Raw Normal View History

const fs = require('fs');
const path = require('path');
const {
override,
removeModuleScopePlugin,
babelInclude,
2022-12-01 01:28:38 +01:00
addWebpackModuleRule,
} = require('customize-cra');
2022-12-01 01:28:38 +01:00
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const addMiniCssExtractPlugin = config => {
config.plugins.push(new MiniCssExtractPlugin());
return config;
}
module.exports = override(
removeModuleScopePlugin(),
2022-12-01 01:28:38 +01:00
addMiniCssExtractPlugin,
addWebpackModuleRule({
test: /\.css$/,
use: [ MiniCssExtractPlugin.loader, 'css-loader' ]
}),
babelInclude([
path.resolve(path.join(__dirname, 'src')),
fs.realpathSync(path.join(__dirname, '../shared')),
]),
);