mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Create App List during generate
This commit is contained in:
parent
9bd7c32ef0
commit
b9cf02791a
1 changed files with 18 additions and 12 deletions
|
|
@ -5,6 +5,20 @@ import pkg from './package'
|
||||||
import buildAppList from './helpers/build-app-list'
|
import buildAppList from './helpers/build-app-list'
|
||||||
|
|
||||||
|
|
||||||
|
const storeAppList = async function (builder) {
|
||||||
|
const appListPath = path.join(
|
||||||
|
// builder.nuxt.options.buildDir,
|
||||||
|
builder.nuxt.options.srcDir,
|
||||||
|
'/assets/app-list.json'
|
||||||
|
)
|
||||||
|
|
||||||
|
const appList = await buildAppList()
|
||||||
|
|
||||||
|
// console.log('builder.nuxt.options', builder.nuxt.options)
|
||||||
|
await fs.writeFile(appListPath, JSON.stringify(appList))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mode: 'universal',
|
mode: 'universal',
|
||||||
target: 'static',
|
target: 'static',
|
||||||
|
|
@ -15,18 +29,10 @@ export default {
|
||||||
*/
|
*/
|
||||||
hooks: {
|
hooks: {
|
||||||
build: {
|
build: {
|
||||||
before: async function (builder) {
|
before: storeAppList
|
||||||
const appListPath = path.join(
|
},
|
||||||
// builder.nuxt.options.buildDir,
|
generate: {
|
||||||
builder.nuxt.options.srcDir,
|
before: storeAppList
|
||||||
'/assets/app-list.json'
|
|
||||||
)
|
|
||||||
|
|
||||||
const appList = await buildAppList()
|
|
||||||
|
|
||||||
// console.log('builder.nuxt.options', builder.nuxt.options)
|
|
||||||
await fs.writeFile(appListPath, JSON.stringify(appList))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue