Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions oidc-ui/craco.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const webpack = require('webpack');

module.exports = {
webpack: {
configure: (webpackConfig) => {
// 1. Fix the "Fully Specified" ESM error (The Axios error)
webpackConfig.module.rules.push({
test: /\.m?js/,
resolve: {
fullySpecified: false,
},
});

// 2. Add the Fallbacks and Aliases inside RESOLVE
webpackConfig.resolve = {
...webpackConfig.resolve,
fallback: {
...webpackConfig.resolve.fallback,
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify'),
vm: require.resolve('vm-browserify'),
buffer: require.resolve('buffer'),
process: require.resolve('process/browser.js'),
},
};

// 3. Global Plugins
webpackConfig.plugins.push(
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
process: 'process/browser.js', // Added .js here
})
);

return webpackConfig;
},
},
};
Loading
Loading