Skip to content

Add build option to set publicPath #976

Closed
@jdesrosiers

Description

@jdesrosiers

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions