-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
40 lines (38 loc) · 1.2 KB
/
next.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
/**
* Critical: prevents "ESM packages (pdfjs-dist/build/pdf.worker.min.mjs) need to be imported." error
*/
esmExternals: 'loose',
// You may not need this, it's just to support moduleResolution: 'node16'
extensionAlias: {
'.js': ['.tsx', '.ts', '.jsx', '.js'],
},
turbo: {
resolveAlias: {
// Turbopack does not support standard ESM import paths yet
'./Sample.js': './pages/Sample.tsx',
/**
* Critical: prevents " ⨯ ./node_modules/canvas/build/Release/canvas.node
* Module parse failed: Unexpected character '�' (1:0)" error
*/
canvas: './empty-module.ts',
},
},
},
/**
* Critical: prevents ''import', and 'export' cannot be used outside of module code" error
* See https://github.com/vercel/next.js/pull/66817
*/
swcMinify: false,
webpack: (config) => {
/**
* Critical: prevents " ⨯ ./node_modules/canvas/build/Release/canvas.node
* Module parse failed: Unexpected character '�' (1:0)" error
*/
config.resolve.alias.canvas = false;
return config;
},
};
export default nextConfig;