Skip to content

Commit

Permalink
Update craco.config
Browse files Browse the repository at this point in the history
  • Loading branch information
RodriSanchez1 committed May 21, 2024
1 parent bedff30 commit 89bdb9b
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions craco.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,24 @@ module.exports = {
resolve: {
extensions: ['.web.js', '.mjs', '.js', '.json', '.web.jsx', '.jsx']
},
configure: {
ignoreWarnings: [
configure: (webpackConfig, { env, paths }) => {
const isCordovaDebug = process.argv.includes('--cordova-debug');
if (isCordovaDebug) {
webpackConfig.mode = 'development';
webpackConfig.optimization = { minimize: false };
console.log('Cordova debug mode enabled');
}

webpackConfig.ignoreWarnings = [
function ignoreSourcemapsloaderWarnings(warning) {
return (
warning.module?.resource.includes('node_modules') &&
warning.details?.includes('source-map-loader')
);
}
]
];

return webpackConfig;
}
},
babel: {
Expand Down

0 comments on commit 89bdb9b

Please sign in to comment.