-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Closed
Labels
Description
Version
Reproduction link
https://codesandbox.io/s/pensive-poitras-84pwh?fontsize=14&hidenavigation=1&theme=dark
Steps to reproduce
I am missing some folders when running a static site. Some folders are there, few are missing. I have adjusted the nuxt.config.js file a little bit, to reuse some of my pages. I am not sure if this is the reason.
Specifically, this is how I reuse my components:
router: {
linkActiveClass: 'is-active',
extendRoutes (routes, resolve) {
const routesToAdd = [
{
name: 'index',
path: '/',
component: resolve(__dirname, 'pages/_slug/index.vue'),
chunkName: 'index'
},
{
name: 'product-category-slug',
path: '/product-category/:category_slug',
component: resolve(__dirname, 'pages/shop.vue'),
chunkName: 'pages/product-category/_slug/index' // this part is important if you want i18n to work
},
{
name: 'product-category-slug-material',
path: '/product-category/:category_slug/in/:material',
component: resolve(__dirname, 'pages/shop.vue'),
chunkName: 'pages/product-category/_slug/_material/index' // this part is important if you want i18n to work
},
{
name: 'designer-slug',
path: '/designer/:designer_slug',
component: resolve(__dirname, 'pages/shop.vue'),
chunkName: 'pages/designer/_slug' // this part is important if you want i18n to work
}
];
const existingRoutesToRemove = routesToAdd.map(route => route.name);
const generateRoutes = routes.filter((route) => {
// console.log('Checking ' + route.name + ' if its included in', existingRoutesToRemove, existingRoutesToRemove.includes(route.name));
return !existingRoutesToRemove.includes(route.name);
});
routesToAdd.forEach(({ name, path, component, chunkName }) => {
generateRoutes.push({
name,
path,
component,
chunkName
});
});
routes.splice(0, routes.length, ...generateRoutes); // set new array
}
},
When running build, I see the /designer/ folder, and the /shop/index.vue for instance, but the /product-category/ is missing. Not sure why.
What is expected ?
I expect the /product-category/ folder to be present on built
What is actually happening?
It is absent
Additional comments?
I am not sure if the codepen I posted allow for static files, so I cannot test it, however, I have tried to replicate my setup.