2023-06-14 19:36:20 +08:00
|
|
|
/**
|
|
|
|
* 子线程
|
|
|
|
* @author yutent<yutent.io@gmail.com>
|
|
|
|
* @date 2023/06/14 16:15:39
|
|
|
|
*/
|
|
|
|
import { workerData } from 'node:worker_threads'
|
|
|
|
import { compileFiles } from './compile.js'
|
|
|
|
|
|
|
|
const { options, data } = workerData
|
|
|
|
|
|
|
|
options.isCustomElement = Function('return ' + options.isCustomElement)()
|
|
|
|
|
2023-06-15 16:54:45 +08:00
|
|
|
console.log('data: ', data.title, Date.now() - data.timeStart)
|
2023-06-14 19:36:20 +08:00
|
|
|
|
2023-06-15 16:54:45 +08:00
|
|
|
// for (let [currentPage, { page, files }] of data.chunk.entries()) {
|
|
|
|
// currentPage && console.log('正在生成 %s ...', `${currentPage}.html`)
|
|
|
|
// compileFiles(currentPage, page, files, options, data)
|
2023-06-14 19:36:20 +08:00
|
|
|
// }
|