-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
40 lines (37 loc) · 1.3 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
/**
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
* for Docker builds.
*/
await import("./src/env.js");
// import { build } from "velite";
import { withContentlayer } from "next-contentlayer";
/** @type {import("next").NextConfig} */
export default withContentlayer({
reactStrictMode: false,
swcMinify: true,
images: { unoptimized: true },
// webpack: (config) => {
// // eslint-disable-next-line
// config.plugins.push(new VeliteWebpackPlugin());
// // eslint-disable-next-line
// return config;
// },
});
// class VeliteWebpackPlugin {
// static started = false;
// constructor(/** @type {import('velite').Options} */ options = {}) {
// this.options = options;
// }
// apply(/** @type {import('webpack').Compiler} */ compiler) {
// // executed three times in nextjs
// // twice for the server (nodejs / edge runtime) and once for the client
// // eslint-disable-next-line
// compiler.hooks.beforeCompile.tapPromise("VeliteWebpackPlugin", async () => {
// if (VeliteWebpackPlugin.started) return;
// VeliteWebpackPlugin.started = true;
// // eslint-disable-next-line
// const dev = compiler.options.mode === "development";
// await build({ watch: dev, clean: !dev });
// });
// }
// }