Repository nuxt.js

Proposal: Add template option for nuxt.config.js

KonstantinVlasov
248
KonstantinVlasov
commented a year 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

2 months ago by manniL

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

0
dotneet
105
dotneet
commented a year 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 a year ago

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

0
dotneet
105
dotneet
commented a year 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 a year ago

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

0
manniL
1.8k
manniL
commented 2 months ago

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

0
Informations
Feature RequestImplemented
#c1718 - Created a year ago