# DuckDuckGo Search Queries for Vue Multi-site Config ## Goal Using vue-cli, set up a project that allows for two distinct web apps to exist in the same repository together: a "main" site and an "admin" site. Each site would have a distinct top-level Vue app (entry point) and a distinct "public/" folder of assets to copy into each site. Each site would have some Vue components specific to itself, but also be able to share components common to both sites. ## Searches All searches done using [DuckDuckGo](https://duckduckgo.com/) 1. Search `man vue-cli-service` (attempting to find the manual page for the vue-cli-service command, to check for CLI options) * Landed on [CLI Service | Vue CLI 3](https://cli.vuejs.org/guide/cli-service.html) * Didn't find anything useful from this page. 2. Went to Vue CLI homepage to learn how to install vue-cli and create a hello-world app of my own, so that I could run `./node_modules/.bin/vue-cli-service --help` and see the man page that way. Didn't find any CLI options that would configure the public folder path in the man page. 3. Search `vue-cli public folder path` * Landed on [HTML and Static Assets | Vue CLI 3](https://cli.vuejs.org/guide/html-and-static-assets.html) * First paragraph says: "The file public/index.html is a template that will be processed with [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin)" * So I knew the part of vue-cli (html-webpack-plugin) responsible for this feature. But how does vue-cli configure it? There is no webpack.config.js, and I searched my hello-world codebase for the word "public" and didn't see any explicit configuration anywhere for it. 4. Search `vue-cli html-webpack-plugin settings` * Landed on [Working with Webpack | Vue CLI 3](https://cli.vuejs.org/guide/webpack.html) * Found my first hint on how you can create a `vue.config.js` and customize options to the html-webpack-plugin (under "Modifying Options of a Plugin"): ```javascript // vue.config.js module.exports = { chainWebpack: config => { config .plugin('html') .tap(args => { args[0].template = '/Users/username/proj/app/templates/index.html' return args }) } } ``` * This let you override the "public/index.html" path with a custom path, and was half of the final solution. (Other half is getting the _other_ "public/*" files to be copied into your dist folder!) 5. Seeing mention of publicPath in places, searched `vue publicPath config` * Landed on [Configuration Reference | Vue CLI 3](https://cli.vuejs.org/config/) and saw mentions of a "publicPath" variable, but it turned out this wasn't what I wanted. publicPath is the HTTP URI of your website root, default is "/", if you changed it to e.g. "/custom-public" then the index.html of your dist/ output references files as e.g. `