Coder Social home page Coder Social logo

Comments (6)

danielroe avatar danielroe commented on June 15, 2024 2

Are you sure? You should be able to provide a fully custom route with it:

<script setup lang="ts">
definePageMeta({
  path: '/some/:custom'
})
</script>

<template>
  <div>
    Nuxt 3 Playground
  </div>
</template>

<style scoped>

</style>

As far as .nuxtignore is concerned, it's not meant for the purpose you're using it for.

Instead, don't add the pages to .nuxtignore and manually remove them in the pages:extend hook (or modify the page route there).

We might be willing to support custom globs for scanning pages later on.

from nuxt.

stackblitz avatar stackblitz commented on June 15, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

from nuxt.

danielroe avatar danielroe commented on June 15, 2024

This is very much expected. What are you trying to achieve by adding it to a list of ignored files, but adding it to the build manually?

from nuxt.

Sakamitsu avatar Sakamitsu commented on June 15, 2024

That's demonstrated in the reproduction. Change the routing of some pages while keeping the original file names. Aliases don't solve this problem. Nuxt also has app/router.options.ts, which perfectly solves this problem. However, I think the behavior of hooks in nuxt.config.ts is not entirely clear from the documentation.

If I can add them manually, why doesn't HMR work?
Why am I able to add these pages in nuxt.config.ts if I have them in .nuxtignore? It seems that the expected behavior would be that Nuxt shouldn't acknowledge their existence at all.

from nuxt.

danielroe avatar danielroe commented on June 15, 2024

Have you tried setting the path in definePageMeta?

from nuxt.

Sakamitsu avatar Sakamitsu commented on June 15, 2024

I use typed-router module and it doesn't support definePageMeta, see this issue victorgarciaesgi/nuxt-typed-router#81
However, even when I use definePageMeta, it still doesn't resolve the ambiguities mentioned above.

from nuxt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.