Skip to content

Config the dev and build html template. #733

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

Closed
Akimyou opened this issue Aug 12, 2018 · 2 comments
Closed

Config the dev and build html template. #733

Akimyou opened this issue Aug 12, 2018 · 2 comments
Labels
type: feature request Request to add a new feature version: next Planned to do or already included in the next(1.0.0) version

Comments

@Akimyou
Copy link

Akimyou commented Aug 12, 2018

Feature request

What problem does this feature solve?

Use a customized dev and build html template(inline some scripts, meta ...).
It will be more freedom.

What does the proposed API look like?

none

How should this be implemented in your opinion?

It is a simple way to use customized build html template, but have to change the vuepress source code.

template: process.env.SERVER_RENDER_TPL || await fs.readFile(path.resolve(__dirname, 'app/index.ssr.html'), 'utf-8')

In this way can use customized dev html template, just change config but not well.

  configureWebpack (config, isServer) {
    for (let i = 0; i < config.plugins.length; i++) {
      const plugin = config.plugins[i]
      if (plugin instanceof HtmlWebpackPlugin) {
        plugin.options.template = devIndexTplPath
      }
    }
  }

May be need a normal config option like this.

config.devTemplate = devTemplatePath
config.buildTemplate = buildTemplatePath

Thanks.

Are you willing to work on this yourself?**

none

@ulivz ulivz added the has workaround Has a workaround label Aug 12, 2018
@ulivz ulivz closed this as completed Aug 12, 2018
@ulivz ulivz added type: feature request Request to add a new feature version: next Planned to do or already included in the next(1.0.0) version TODO and removed has workaround Has a workaround labels Aug 20, 2018
@ulivz ulivz reopened this Aug 20, 2018
@timberkeley
Copy link

This would be very useful to me as I am attempting to use vuepress to generate golang templates to integrate static content into a larger web application. I am sure there are many other scenarios where the wrapping html would need to be altered.

@ulivz
Copy link
Member

ulivz commented Sep 16, 2018

Added this feature at 38b3468

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request Request to add a new feature version: next Planned to do or already included in the next(1.0.0) version
Projects
None yet
Development

No branches or pull requests

3 participants