2022-11-23 23:36:30 +01:00
|
|
|
const fs = require('fs');
|
|
|
|
const path = require('path');
|
|
|
|
const {
|
|
|
|
override,
|
|
|
|
removeModuleScopePlugin,
|
|
|
|
babelInclude,
|
2022-12-01 01:28:38 +01:00
|
|
|
addWebpackModuleRule,
|
2022-11-23 23:36:30 +01:00
|
|
|
} = 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;
|
|
|
|
}
|
|
|
|
|
2022-11-23 23:36:30 +01:00
|
|
|
module.exports = override(
|
|
|
|
removeModuleScopePlugin(),
|
2022-12-01 01:28:38 +01:00
|
|
|
addMiniCssExtractPlugin,
|
|
|
|
addWebpackModuleRule({
|
|
|
|
test: /\.css$/,
|
|
|
|
use: [ MiniCssExtractPlugin.loader, 'css-loader' ]
|
|
|
|
}),
|
2022-11-23 23:36:30 +01:00
|
|
|
babelInclude([
|
|
|
|
path.resolve(path.join(__dirname, 'src')),
|
|
|
|
fs.realpathSync(path.join(__dirname, '../shared')),
|
|
|
|
]),
|
|
|
|
);
|