question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add build option to set publicPath

See original GitHub issue

What 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:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
yyx990803commented, Mar 13, 2018

Use baseUrl option in vue.config.js.

2reactions
yyx990803commented, May 14, 2018

@johansaldes baseUrl is a top level property, not a devServer option.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found