Pessoal. Aqui no Alura temos um curso que ensina a fazer uma single-page application com Vue Js. Eu aprendi a usar a ferramenta do Vue Router e etc. Porém, eu estava tentando aprender a criar uma multi-page application, que seria o inverso da single page application. Descobri que devo trabalhar com a configuração do CLI por meio do arquivo vue.config.js, no qual devo usar os "entry points" para cada página independente que desejo criar. A documentação tem o seguinte modelo de código:
module.exports = {
pages: {
index: {
// entry for the page
entry: 'src/index/main.js',
// the source template
template: 'public/index.html',
// output as dist/index.html
filename: 'index.html',
// when using title option,
// template title tag needs to be <title><%= htmlWebpackPlugin.options.title %></title>
title: 'Index Page',
// chunks to include on this page, by default includes
// extracted common chunks and vendor chunks.
chunks: ['chunk-vendors', 'chunk-common', 'index']
},
// when using the entry-only string format,
// template is inferred to be `public/subpage.html`
// and falls back to `public/index.html` if not found.
// Output filename is inferred to be `subpage.html`.
subpage: 'src/subpage/main.js'
}
}
Todavia, quando crio este arquivo e adiciono os entry points, não tenho o comportamento esperado, que é de transitar entre páginas pela url conforme cada entry point. Alguém sabe me dizer como resolvo isso? Parece que não é tão simples quanto a documentação faz crer. OBS: sei que tenho que criar um main.js para cada App.vue correspondente a cada página, mas isso não parece resolver o problema também.