Vue-cli: Setting indexPath to ../index.html should include outputDir in paths for index.html

Created on 19 Aug 2018  Â·  1Comment  Â·  Source: vuejs/vue-cli

Version

3.0.1

Reproduction link

https://github.com/scherii/vue-cli-indexpath-outputdir

Node and OS info

Node 10.8.0 / npm 6.4.0, macOS 10.13.6

Steps to reproduce

Set indexPath in vue.config.js to a relative path above outputDir → ../index.html

What is expected?

The generated index.html should contain paths starting with the outputDir /dist/, for example:
<script src=/dist/js/app.9bbe8c9b.js></script>

What is actually happening?

The paths start without the outputDir:
<script src=/js/app.9bbe8c9b.js></script>


I would like to have all built Vue files in one directory (./dist/) and a index.html at the root level, e.g. one directory above the outputDir (./index.html) to create symlinks for /dist and index.html in a Gitlab CI/CD workflow.

Most helpful comment

You are misunderstanding the point of this option. The asset paths are determined solely by baseUrl, regardless where your index.html is generated in. The indexPath option only serves as a convenience option when you want to generate the index.html in a server-side framework's view directory so that it can be used as a server-side template.

For you specific need, use assetsDir instead.

>All comments

You are misunderstanding the point of this option. The asset paths are determined solely by baseUrl, regardless where your index.html is generated in. The indexPath option only serves as a convenience option when you want to generate the index.html in a server-side framework's view directory so that it can be used as a server-side template.

For you specific need, use assetsDir instead.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chasegiunta picture chasegiunta  Â·  3Comments

JIANGYUJING1995 picture JIANGYUJING1995  Â·  3Comments

eladcandroid picture eladcandroid  Â·  3Comments

brandon93s picture brandon93s  Â·  3Comments

Gonzalo2683 picture Gonzalo2683  Â·  3Comments