v2: prepare to move

This commit is contained in:
endiliey 2018-09-17 11:16:07 +08:00
parent dc7ef96849
commit 45736200b0
172 changed files with 0 additions and 0 deletions

18
v2/lib/load/pages.js Normal file
View file

@ -0,0 +1,18 @@
const globby = require('globby');
const {encodePath, fileToPath} = require('./utils');
async function loadPages(pagesDir) {
const pagesFiles = await globby(['**/*.js'], {
cwd: pagesDir
});
const pagesMetadatas = await Promise.all(
pagesFiles.map(async source => ({
path: encodePath(fileToPath(source)),
source
}))
);
return pagesMetadatas;
}
module.exports = loadPages;