Repository nuxt.js

Proposal: Add template option for nuxt.config.js

KonstantinVlasov
248
KonstantinVlasov
commented 10 months ago

It would be awesome if we can set app.html template src in the config like we do with global css:

module.exports = {
  template: 'app.html',
}

or

module.exports = {
  template: {src: 'template/app.pug', lang: 'pug'},
}

In this way we can share template between multi nuxt apps.

idea
4

Implemented

11 days ago by manniL

Already possible by creating an app.html in your project root directory

0
dotneet
105
dotneet
commented 10 months ago

build.templates property is already exists and similar to that.
https://nuxtjs.org/api/configuration-build#templates

So I think it would be more natural if that feature will be implemented as a special form of build.templates like this:

build: {
  templates: [{
    type: 'app',
    src: '~/templates/app.html',
  }]
}
0
KonstantinVlasov
248
KonstantinVlasov
commented 10 months ago

wow, I don't know how I missing this option it the docs, thanks mate!

0
dotneet
105
dotneet
commented 10 months ago

@KonstantinVlasov Sorry for my poor english. probably I misled you. I've corrected my previous comment, so please read it again. the feature you want is not implemented at present. So I hope this proposal reopen.

0
KonstantinVlasov
248
KonstantinVlasov
commented 10 months ago

oh, I did not have time to check this option yet, thanks

0
manniL
759
manniL
commented 11 days ago

Already possible by creating an app.html in your project root directory. needs doc PR though.

0
Informations
Feature RequestImplemented
#c1718 - Created 10 months ago