|
1 | 1 | import "./env.mjs" |
2 | | -import { build } from "velite" |
| 2 | +// import { build } from "velite" |
3 | 3 |
|
4 | 4 | /** @type {import('next').NextConfig} */ |
5 | 5 | const nextConfig = { |
6 | 6 | images: { |
7 | 7 | domains: ["avatars.githubusercontent.com"], |
8 | 8 | }, |
9 | 9 | webpack: config => { |
10 | | - config.plugins.push(new VeliteWebpackPlugin()) |
| 10 | + // config.plugins.push(new VeliteWebpackPlugin()) |
11 | 11 | return config |
12 | 12 | } |
13 | 13 | } |
14 | 14 |
|
15 | | -class VeliteWebpackPlugin { |
16 | | - static started = false |
17 | | - apply(/** @type {import('webpack').Compiler} */ compiler) { |
18 | | - // executed three times in nextjs |
19 | | - // twice for the server (nodejs / edge runtime) and once for the client |
20 | | - compiler.hooks.beforeCompile.tapPromise('VeliteWebpackPlugin', async () => { |
21 | | - if (VeliteWebpackPlugin.started) return |
22 | | - VeliteWebpackPlugin.started = true |
23 | | - const dev = compiler.options.mode === 'development' |
24 | | - await build({ watch: dev, clean: !dev }) |
25 | | - }) |
26 | | - } |
27 | | -} |
| 15 | +// class VeliteWebpackPlugin { |
| 16 | +// static started = false |
| 17 | +// apply(/** @type {import('webpack').Compiler} */ compiler) { |
| 18 | +// // executed three times in nextjs |
| 19 | +// // twice for the server (nodejs / edge runtime) and once for the client |
| 20 | +// compiler.hooks.beforeCompile.tapPromise('VeliteWebpackPlugin', async () => { |
| 21 | +// if (VeliteWebpackPlugin.started) return |
| 22 | +// VeliteWebpackPlugin.started = true |
| 23 | +// const dev = compiler.options.mode === 'development' |
| 24 | +// await build({ watch: dev, clean: !dev }) |
| 25 | +// }) |
| 26 | +// } |
| 27 | +// } |
28 | 28 |
|
29 | 29 | export default nextConfig |
0 commit comments