Add build option to set publicPath
See original GitHub issueWhat problem does this feature solve?
I’m trying to deploy a Vue.js application to Github Pages. Github Pages deploys to a URL that looks like username.github.io/repo-name. The problem is that the vue-cli-service build
command builds links that look like /js/vendor.2e8c48c3.js
rather than repo-name/js/vendor.2e8c48c3.js
or ./js/vendor.2e8c48c3.js
.
There is a webpack option, publicPath
, that I’m pretty sure is the solution, but there isn’t a way to set that option with vue-cli.
https://webpack.js.org/api/cli/#output-options https://github.com/webpack/docs/wiki/configuration#outputpublicpath
What does the proposed API look like?
vue-cli-service build --publicPath='/repo-name'
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Public Path - webpack
The publicPath configuration option can be quite useful in a variety of scenarios. It allows you to specify the base path for all...
Read more >vue.js - dynamically setting __webpack_public_path__ ...
To configure Webpack - set it's output.publicPath option. The value is important both at build time and runtime. At runtime it is made...
Read more >Configuration Reference | Vue CLI
If your app is deployed at a sub-path, you will need to specify that sub-path using this option. For example, if your app...
Read more >Webpack — Understanding the 'publicPath' mystery - Medium
So, here I am going to unfold the mystery of publicPath config based on my experience and understanding. Please feel free to provide...
Read more >Configuring quasar.config.js
quasar/app-webpack) Where, how and what you can configure in a Quasar app. ... build, Object, Build configuration options.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Use baseUrl option in vue.config.js.
@johansaldes
baseUrl
is a top level property, not adevServer
option.