Answer the question
In order to leave comments, you need to log in
How to use multiple SPA applications with Vue CLI?
It is necessary to split the application into two separate SPA applications.
There is a main application and an admin panel for it.
In vue.config.js described pages
pages: {
index: {
entry: 'src/apps/app/main.js',
template: 'public/index.html',
filename: 'index.html',
title: process.env.VUE_APP_NAME || 'Application'
},
admin: 'src/apps/admin/main.js',
},
Answer the question
In order to leave comments, you need to log in
The build (npm run build) creates two .html files in dist, index.html and admin.html.
And in this case, when I go to /admin, I get a 404.
server {
listen 80;
location /admin {
root /usr/share/nginx/html;
index admin.html
try_files $uri $uri/ /admin.html;
}
location / {
root /usr/share/nginx/html;
index index.html
try_files $uri $uri/ /index.html;
}
}
base: '/admin/'
.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question