Skip to content

Commit 42a5650

Browse files
committed
chore: npm scripts
1 parent 580ab50 commit 42a5650

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

next.config.mjs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
import "./env.mjs"
2-
import { build } from "velite"
2+
// import { build } from "velite"
33

44
/** @type {import('next').NextConfig} */
55
const nextConfig = {
66
images: {
77
domains: ["avatars.githubusercontent.com"],
88
},
99
webpack: config => {
10-
config.plugins.push(new VeliteWebpackPlugin())
10+
// config.plugins.push(new VeliteWebpackPlugin())
1111
return config
1212
}
1313
}
1414

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+
// }
2828

2929
export default nextConfig

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"scripts": {
1010
"dev": "next dev",
11-
"build": "next build",
11+
"build": "velite && next build",
1212
"turbo": "next dev --turbo",
1313
"start": "next start",
1414
"lint": "next lint",

0 commit comments

Comments
 (0)