Hi,
Iād like to generate valid html output when in production⦠Actually there are 3 problems:
n-head-ssr in the default app.htmlapp.html: <script type="text/javascript" defer>window.__NUXT__=<%= serialize(context.nuxt, { isJSON: true }) %></script>
For the first point, this is a webpack configuration to add, but maybe having simple options to switch in nuxt.config.js would be better? And with a default to not remove spaces? Actually, I couldn't find yet how to get this properly with the extend options.
The third point could be solved by using a custom Template, but once again, shouldn't an "out-of-the-box" code be valid in the first time?
Thanks for your help.
Hi @EmmanuelBeziat
- html attributes comes without spacing when minified ā This isnāt allowed(http://www.w3.org/TR/html5/syntax.html#start-tags see point 4)
This is fixed in the next release, and the html-minifier option will be customizable via generate.minify in the nuxt.config.js
- defer in scripts that are not loaded ā a script tag is added at the end of the file, with the attribute defer, but it's only allowed if the attribute src="" is used; not on "containing" script tags.
Fixed in the upcoming release.
- n-x attributes are used ā html5 only allow custom attributes if they start by data-*. How can I change this settings? The html-head section of the doc show the custom attributes names, but donāt explain if itās customisable, and how. Besides, thereās also a n-head-ssr in the default app.html
I can change it, but the HTML is still not valid because of the server-rendered attribute of vue.js:

I asked Evan if we can customize this attribute to be able to generate valid HTML markup, I'll keep this thread updated š
Yay, awesome. Thanks a lot!
The 0.10 release it out ā
I talked to Evan You, he will update the server-rendered key to data-server-rendered to generate 100% valid HTML.
Excellent! Thanks again!
Hi, me again, sorry!
Thereās another issue with vue-meta, as "hid" isnāt valid. Is there a way to change it to something else (like simply "id")? If I change it myself, itās not replaced in child views.
Thanks!
Hi,
Any update on this?
Thanks!
@EmmanuelBeziat
vue 2.3 released
https://github.com/vuejs/vue/releases/tag/v2.3.0
server-rendered -> data-server-rendered
seems we can validate w3c forward a step
thanks all of nuxt.js and vue.js creator .
@ausir0726 Hi :)
Yes, the only thing missing is the "hid" ā thatās what I was asking news about š
opps ...
don't know it belong vue-meta or nuxt.js scope ?
Donāt really know⦠I supposed it to be a part of vue-meta.
Hi! Any updates on this? Thanks!
Closing since rc3 is out :)
Ok, thanks!
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.
Most helpful comment
The 0.10 release it out ā
I talked to Evan You, he will update the
server-renderedkey todata-server-renderedto generate 100% valid HTML.