-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.mjs
34 lines (31 loc) · 942 Bytes
/
next.config.mjs
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
// @ts-check
// Note: when using Preact, it's necessary to prepend all `key`s with `.$`:
// see https://github.com/vercel/next.js/issues/32944#issuecomment-1008280432.
import withPreact from 'next-plugin-preact';
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
poweredByHeader: false,
trailingSlash: true,
sassOptions: {
includePaths: ['./src/styles'],
},
typescript: {
// Because we use Preact (NextJS uses React & its typedefs)
ignoreBuildErrors: true,
},
compiler: {
// Remove `^data-test` properties (used by Selenium etc as a selector)
reactRemoveProperties: true,
// Remove `console.*` statements except `console.error`
removeConsole: {
exclude: ['error'],
},
},
experimental: {
// Ensure `preact/compat` imports are the same version
// https://github.com/preactjs/next-plugin-preact/issues/53
esmExternals: false,
},
};
export default withPreact(nextConfig);