Skip to content

Conversation

jkzing
Copy link
Member

@jkzing jkzing commented Dec 25, 2018

With multi-page configuration like:

module.exports = {
  pages: {
    main: {
      entry: 'src/main.js',
      template: 'public/index.html',
      filename: 'index.html'
    },
    preview: {
      entry: 'src/preview.js',
      template: 'public/index.html',
      filename: 'preview.html'
    }
  }
}

HTML for page preview can only be accessed by localhost:8080/preview.html.

This plays well with vue-router + hash mode. But with history mode, preview.html would not be accessible.

eg. accessing localhost:8080/preview.html/about will result in index.html because /preview.html/about is a not found request and being fallback.

This PR adds support for multi-page fallback, it fallback ${baseUrl}/${name of page} to the correct html file (filename specified or ${name}.html).

In above case, the two pages could be accessed by localhost:8080/main and localhost:8080/preview.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants