mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-25 04:19:02 +08:00
add stats to the console output
This commit is contained in:
parent
6305e865a7
commit
c5d84aa87e
@ -10,6 +10,9 @@ module.exports = function (api) {
|
||||
cwd: process.cwd(),
|
||||
})
|
||||
|
||||
let numberOfPages = 0
|
||||
let numberOfDemos = 0
|
||||
|
||||
api.loadSource(() => {
|
||||
/**
|
||||
* Generate pages for all demo components for testing purposes
|
||||
@ -28,6 +31,8 @@ module.exports = function (api) {
|
||||
demos.push(match[1])
|
||||
})
|
||||
|
||||
numberOfDemos = demos.length
|
||||
|
||||
api.createPages(({ createPage }) => {
|
||||
createPage({
|
||||
path: '/demos',
|
||||
@ -76,8 +81,16 @@ module.exports = function (api) {
|
||||
})
|
||||
|
||||
api.onCreateNode(options => {
|
||||
if (process.env.NODE_ENV === 'production' && options.internal.typeName === 'DocPage') {
|
||||
if (options.internal.typeName === 'DocPage') {
|
||||
numberOfPages += 1
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
createSpecificOpenGraphImage(options.title, options.content, `static/images${options.path}og-image.png`)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
api.configureServer(() => {
|
||||
console.log(`[STATS] ${numberOfPages} pages, ${numberOfDemos} interactive demos`)
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user