Skip to content

Commit

Permalink
Removed unecessary craco conf
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenewald committed May 26, 2023
1 parent f0640a8 commit 0f2d9c5
Showing 1 changed file with 0 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -1,39 +1,6 @@
const webpack = require('webpack');
const isDevelopment = false;
module.exports = {
webpack: {
configure: (webpackConfig) => {
if (!isDevelopment) {
const reactRefreshPluginIndex = webpackConfig.plugins.findIndex(
(plugin) => plugin.constructor.name === 'ReactRefreshPlugin'
);

if (reactRefreshPluginIndex !== -1) {
webpackConfig.plugins.splice(reactRefreshPluginIndex, 1);
}

const babelLoader = webpackConfig.module.rules
.find(
(rule) =>
rule.oneOf &&
rule.oneOf.find(
(r) => r.loader && r.loader.includes('babel-loader')
)
)
.oneOf.find((r) => r.loader && r.loader.includes('babel-loader'));

const reactRefreshBabelIndex = babelLoader.options.plugins.findIndex(
(plugin) =>
plugin && plugin.includes && plugin.includes('react-refresh/babel')
);

if (reactRefreshBabelIndex !== -1) {
babelLoader.options.plugins.splice(reactRefreshBabelIndex, 1);
}
}
return webpackConfig;
},
},
style: {
postcss: {
plugins: [
Expand Down

0 comments on commit 0f2d9c5

Please sign in to comment.