fix build issues
This commit is contained in:
parent
8f793d258d
commit
9bd74867c1
5 changed files with 424 additions and 15 deletions
39
ui/next.config.js
Normal file
39
ui/next.config.js
Normal file
|
@ -0,0 +1,39 @@
|
|||
/* eslint-disable unicorn/prefer-module */
|
||||
// eslint-disable-next-line no-undef, @typescript-eslint/no-var-requires
|
||||
const webpack = require("webpack");
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
images: {
|
||||
remotePatterns: [
|
||||
{
|
||||
hostname: "s2.googleusercontent.com",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
webpack: (config, { isServer }) => {
|
||||
if (!isServer) {
|
||||
config.resolve.fallback = {
|
||||
...config.resolve.fallback,
|
||||
// eslint-disable-next-line no-undef
|
||||
stream: require.resolve("stream-browserify"),
|
||||
// eslint-disable-next-line no-undef
|
||||
crypto: require.resolve("crypto-browserify"),
|
||||
};
|
||||
|
||||
config.plugins.push(
|
||||
new webpack.ProvidePlugin({
|
||||
process: "process/browser",
|
||||
}),
|
||||
new webpack.NormalModuleReplacementPlugin(/node:crypto/, resource => {
|
||||
resource.request = resource.request.replace(/^node:/, "");
|
||||
}),
|
||||
);
|
||||
}
|
||||
return config;
|
||||
},
|
||||
};
|
||||
|
||||
// eslint-disable-next-line no-undef
|
||||
module.exports = nextConfig;
|
Loading…
Add table
Add a link
Reference in a new issue