2023-05-31 16:13:27 +02:00
|
|
|
/** @type {import('next').NextConfig} */
|
2023-06-24 08:06:24 +02:00
|
|
|
const nextConfig = {
|
|
|
|
// Nextjs has an issue with pdfjs-dist which optionally uses the canvas package
|
|
|
|
// for Node.js compatibility. This causes a "Module parse failed" error when
|
|
|
|
// building the app. Since pdfjs-dist is only used on client side, we disable
|
|
|
|
// the canvas package for webpack
|
|
|
|
// https://github.com/mozilla/pdf.js/issues/16214
|
2023-06-26 23:58:31 +02:00
|
|
|
output: 'standalone',
|
2023-06-24 08:06:24 +02:00
|
|
|
webpack: (config) => {
|
|
|
|
// Setting resolve.alias to false tells webpack to ignore a module
|
|
|
|
// https://webpack.js.org/configuration/resolve/#resolvealias
|
|
|
|
config.resolve.alias.canvas = false;
|
|
|
|
config.resolve.alias.encoding = false;
|
|
|
|
return config;
|
|
|
|
},
|
|
|
|
};
|
2023-05-31 16:13:27 +02:00
|
|
|
|
2023-06-24 08:06:24 +02:00
|
|
|
module.exports = nextConfig;
|