Giter Club home page Giter Club logo

Comments (9)

bluebeel avatar bluebeel commented on June 18, 2024 2

A forgotten on my part in the readme sorry.

You have to add an option in the nuxt.config.js file

build:  {
      filenames: {
        app: '[name].js',
        chunk: '[name].js'
      }
}

I put this option mandatory because i need to determine which output file is app.js, commons.js, runtime.js and files from different pages. So it's much simpler if at the output I have the name of the files rather than a hash.

And don't forget to change the way the object is returned.
The default nuxt.config.js is

export default {
  ...
}

To

module.exports = () => {
  return { ... }
}

from now-nuxt.

Chaoyingz avatar Chaoyingz commented on June 18, 2024 1

@bluebeel Thank you very much!

from now-nuxt.

Chaoyingz avatar Chaoyingz commented on June 18, 2024

I had the same issue

from now-nuxt.

dohomi avatar dohomi commented on June 18, 2024

@bluebeel could you maybe give a hint at the docs how to configure the routes section of the now.json file? Currently I've seen that you enabled some for the more advanced example, the basic example does not have a routes section. I'm quite confused if its necessary to set up or if I can leave it empty.

from now-nuxt.

bluebeel avatar bluebeel commented on June 18, 2024

You must use routes if you manage dynamic routes. This is the difference between the basic and complex example. In the basics, I have 2 "static" paths (/and /about) and the complex, several dynamic path.
By default, now does not manage these, so we must help him and tell him which lambda to use for dynamic routes.

The routes section accept regex patterns (PCRE).
So if you look at Output from my complex example, you will see that there are 4 lambdas in total.

  • Index : lambda by default
  • user/_id : the lambda to manage the path user/:id ie: user/123456
  • item/_id : the lambda to manage the path item/:id ie: item/123456 or item/7891234
  • _feed/_page : the lambda to manage the path :feed/:page ie: news/1 or ask/2

now uses index as a default since he is there.
For other path I use the routes section.

I hope it's clear otherwise as soon as I can I'll do a more complete example to explain what can be done with the routes section.

from now-nuxt.

dohomi avatar dohomi commented on June 18, 2024

@bluebeel I followed your advised. But for me nothing changed, I still only receive a directory listing. Does it has to do that I use a srcDir because thats all I might have differently to your setup. I only have one index.vue file which should receive all incoming requests. I configured nuxt.config.js to forward all requests as you can see above. I added the filenames section inside of the build section but I still receive the same output: https://nuxt-storyblok-naturheilpraxis-e25y5avsw.now.sh

from now-nuxt.

bluebeel avatar bluebeel commented on June 18, 2024

@dohomi can you make a public deployment if possible?
It's weird you don't even have the pages folder with your index.js output.

Does changing the srcDir also change the output folder of the pages? If yes, it might be the cause.

from now-nuxt.

dohomi avatar dohomi commented on June 18, 2024

@bluebeel Ok I disabled all the personal config and now it built successful. There might be some issues with my config - I will enable step by step and report back which was causing the issue

from now-nuxt.

bluebeel avatar bluebeel commented on June 18, 2024

ok open a new issue if needed

from now-nuxt.

Related Issues (10)

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.