2021-09-09 02:22:11 +00:00
|
|
|
const isCoverage = process.env.COVERAGE === "true";
|
|
|
|
const babelPlugins = isCoverage ? ["babel-plugin-istanbul"] : [];
|
2021-09-28 06:27:06 +00:00
|
|
|
const cracoPlugins = isCoverage
|
|
|
|
? [
|
|
|
|
{
|
|
|
|
plugin: require("craco-alias"),
|
|
|
|
options: {
|
|
|
|
source: "tsconfig",
|
|
|
|
baseUrl: "./src",
|
|
|
|
tsConfigPath: "./tsconfig.aliases.json",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
: [
|
|
|
|
{
|
|
|
|
plugin: require("craco-alias"),
|
|
|
|
options: {
|
|
|
|
source: "tsconfig",
|
|
|
|
baseUrl: "./src",
|
|
|
|
tsConfigPath: "./tsconfig.aliases.json",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
plugin: require("craco-esbuild"),
|
|
|
|
options: {
|
|
|
|
enableSvgr: true,
|
|
|
|
esbuildMinimizerOptions: {
|
|
|
|
target: "es2015",
|
|
|
|
css: true,
|
|
|
|
minify: true,
|
|
|
|
},
|
|
|
|
skipEsbuildJest: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
];
|
2021-06-19 08:20:43 +00:00
|
|
|
|
2020-11-19 01:50:34 +00:00
|
|
|
module.exports = {
|
|
|
|
babel: {
|
2021-06-19 08:20:43 +00:00
|
|
|
plugins: babelPlugins,
|
|
|
|
},
|
2021-09-28 06:27:06 +00:00
|
|
|
plugins: cracoPlugins,
|
2021-06-19 08:20:43 +00:00
|
|
|
};
|