VueJS-#14 Publish to Webserver

Buat Config

Buat file vue.config.js di Path Proyek “/”, dengan isi seperti di bawah ini :

// vue.config.js
module.exports = {
    publicPath: process.env.NODE_ENV === 'production'
    ? '/dist/'
    : '/'

Artinya jika di build maka path = /dist/, akan berpengaruh saat diupload ke htdocs Apache

npm run build
After Build

Copy folder dist ke htdocs/dist, jalankan apache lalu buka page di browser.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>