Vue-cli: use custom index.html

Created on 2 Feb 2018  路  7Comments  路  Source: vuejs/vue-cli

Version

3.0.0-alpha.5

Reproduction link

https://github.com/greenpdx/rustwasm

Steps to reproduce

npm install

npm run serve

What is expected?

I added a index.html in the root directory, I want to use that html file

What is actually happening?

the server is generating it own index.html


I am trying to load a opencv as wasm file inside a js file. I run out of memory if I try to import it because webpack tries to parse and optimize it. The example in opencvjs shows it added in the html file.

I want to use a custom index.html and add it there.

Most helpful comment

index.html is in the public directory.

All 7 comments

index.html is in the public directory.

@yyx990803 What's the solution if I want to specify a different custom HTML file? For example, in my project I have a demo/ subdirectory which is essentially a small project in its own right. In my project root directory, I define a dev npm script in package.json: vue-cli-service serve demo/src/main.ts.

I want my demo to use a custom HTML file that I've created as <root>/demo/public/index.html. However, running npm run dev makes it bundle <root>/public/index.html instead.

@TAGC for now you will have to use an env variable and conditionally modify the options for the HTML plugin in vue.config.js.

Ah okay, fair enough.

@yyx990803 Which env variable and options?

if I wrote npm run dev automatically opened app.vue. But i want change this, namely if I wrote npm run dev in my cmd then opened blogs.vue(FOR VUE.JS). How can I change this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eladcandroid picture eladcandroid  路  3Comments

NathanKleekamp picture NathanKleekamp  路  3Comments

Akryum picture Akryum  路  3Comments

JIANGYUJING1995 picture JIANGYUJING1995  路  3Comments

csakis picture csakis  路  3Comments