You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> UPD.1: I found reference for multiple pages in the vue-cli source code. I think it's not yet documented. UPD.2: See config [documentation](https://cli.vuejs.org/config/#pages) for create multiple pages.
4
+
5
+
---
6
+
7
+
For example we need build two different app instances:
8
+
9
+
- index - `/`;
10
+
- dashboard - `/manage`.
11
+
12
+
Simple way add **pages** config reference to **vue.config.js**.
13
+
14
+
Full config you can see [here](vue.config.js).
15
+
16
+
> Old example using [webpack-chain](https://github.com/mozilla-neutrino/webpack-chain) is [here](https://github.com/mavajee/guide__vue-cli-3-multiple-entry-points/tree/chain-usage).
17
+
18
+
## Configure **vue.config.js**
19
+
20
+
With **pages** api you don't need manually edit entry points. You just define each your page like this:
Using vue router you will see error, for fix configure [historyApiFallback](https://webpack.js.org/configuration/dev-server/#devserver-historyapifallback) for **webpack-dev-server**:
For more, if you need configure nginx you can make something like this:
53
+
54
+
```js
55
+
server {
56
+
listen 80;
57
+
58
+
location ~^/manage(.*)$ {
59
+
proxy_pass http://127.0.0.1:8550/manage/$1;
60
+
}
61
+
}
62
+
```
63
+
64
+
Best way if on a each entry point configure own location. See full config [here](configs/nginx.dev.conf).
65
+
66
+
Using non "localhost" host HMR can not be working. And for it add [allowedHosts](https://webpack.js.org/configuration/dev-server/#devserver-allowedhosts) to `webpack-dev-server` or edit server headers.
0 commit comments