New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allowing config output.publicPath of webpack (for CDN) #25
Comments
Hi! I'm happy that your team like nuxt.js :) To be sure, all files in your static folder will be on the CDN, but not the generated JS and CSS files from Nuxt.js right? |
No, I mean the files generated by Nuxt.js (webpack behind the scene), that is, the Maybe I will remove |
What do you think of an publicPath should not be changed to another directory (because of how Nuxt.js static middleware works), but having a Example of module.exports = {
build: {
cdn: 'https://example.cnd.com/nuxt/'
}
} I will also make the generation of the JS files to have a |
I think CDN and static middleware are mutually exclusive. If you set publicPath a value begin with |
I added I might be able to add |
Just as a reference, I think You guys doing a great job, haven't used it much yet but looking forward to use it in an upcoming project. |
@Atinux Could this be added? I'm currently editing it manually to the CDN As for @fenivana for public assets that are located in /static/ you can manually or create a helper function to generate a full CDN url so instead of:
|
@voidale it's planned to be added before the 1.0 |
@Atinux I noticed you're setting nuxtStatic to false automatically https://github.com/nuxt/nuxt.js/blob/0.9.10/lib/build.js#L88-L91. I think this should be a manual thing otherwise service like cloudfront won't work. Cloudfront works by grabbing the files from the main url if they aren't cached yet. I.e. if you have https://mysite.cloudfront.net/static/favicon.ico and Cloudfront doesn't have that file, it will grab it from https://mysite.com/static/favicon.ico. So in that case |
@Atinux If I also support http and https, I would begin with '//xxx.xxx.com' instead 'http://xxx.xxx.com' or 'https://xxx.xxx.com'. |
I updated the code to take care of it as well @rubyless |
The 0.10 release it out ✋ It took a while but it's now fully working! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Currently, I see
output.publicPath
is automatically set tourlJoin(this.options.router.base, '/_nuxt/')
. But we need to put the static assets to a CDN, something likecdn.example.com
. So could you add an option innuxt.config.js
to allow us set a publicPath manually?I and my team really like nuxt.js, it made SSR super damn easy. We are using it in our new project.
Keep on guys!
The text was updated successfully, but these errors were encountered: