Comments (9)
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.
@bluebeel Thank you very much!
from now-nuxt.
I had the same issue
from now-nuxt.
@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.
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
oritem/7891234
- _feed/_page : the lambda to manage the path
:feed/:page
ie:news/1
orask/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.
@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.
@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.
@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.
ok open a new issue if needed
from now-nuxt.
Related Issues (10)
- <nuxt-link> doesn't work as expected
- The lambda function size (130.17mb) exceeds the configured limit (50mb). HOT 12
- Improve build time
- Build fails HOT 3
- in dev mode, nuxt.config.js not work. HOT 10
- best routes config for a catch-all index.vue page HOT 15
- Error in build which then fails. HOT 3
- Not working with a fresh template created with create-nuxt-app HOT 4
- using hashed version of js files HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from now-nuxt.