feat(v2): shorter chunk naming for pages (#1688)

* refactor(v2): dont show absolute path for pages chunk/source naming

* test n changelog
This commit is contained in:
Endi 2019-07-23 05:53:30 +07:00 committed by Yangshun Tay
parent f1a504e813
commit 6287739bec
3 changed files with 10 additions and 5 deletions

View file

@ -22,15 +22,15 @@ describe('docusaurus-plugin-content-pages', () => {
siteConfig,
});
const pagesMetadatas = await plugin.loadContent();
const pagesDir = plugin.contentPath;
const pagesPath = path.relative(siteDir, plugin.contentPath);
expect(pagesMetadatas).toEqual([
{
permalink: '/',
source: path.join(pagesDir, 'index.js'),
source: path.join('@site', pagesPath, 'index.js'),
},
{
permalink: '/hello/world',
source: path.join(pagesDir, 'hello', 'world.js'),
source: path.join('@site', pagesPath, 'hello', 'world.js'),
},
]);
});