nuxt-build-cache
A small tool that manages a nuxt build directory based on current version and last build info.
This is for people who do not wish to pre-build their nuxt projects for each environment but do not wish either to run the full build at each start/restart or replication of the service. A lock file is used to manage concurrency in case of service replication.
const nuxtBuildCache = require('@koumoul/nuxt-build-cache')
const nuxtConfig = require('./nuxt.config')
const version = process.env.VERSION || require('./package.json').version
async function main() {
// this will build only if necessary based on last build info and current version
const nuxt = await nuxtBuildCache.prepare('my-project', version, nuxtConfig)
const app = require('express')()
app.use(nuxt.render)
...
}