[Vuejs]-How to split files in a spa built with Vue.js into public and private parts?

0👍

This is the first part of the implementation…
You need a javascript entry file for each part plus a separate router file…
Then in the vue.config.js you can add…

module.exports = {
  pages: {
    publicSide: {
      entry: 'src/main.ts',
      template: 'public/index.html',
      filename: 'index.html',
      title: 'Public Page'
    },
    privateSide: {
      entry: 'src/private.ts',
      template: 'private/index.html',
      filename: 'private.html',
      title: 'Private Page'
    }
  }
}

I still have to figure out how to generate 2 output folders instead of one…

Leave a comment