[Vuejs]-How to deploy a vuejs/flask project on apache

0👍

I found the issue has nothing to do with the way how Flask project is deployed – it’s about the configuration of the vuejs frontend.

I need to adjust the setting of assetsPublicPath in vuejs’s config file, to a proper location where the index.html can find the obfuscated javascripts.

For example, if my project is called “ABC”, and i want the url looks like:

http://my-site.com/ABC

I need to have this in the vuejs config file:

env: require('./prod.env'),
index: path.resolve(__dirname, '../../dist/index.html'),
assetsRoot: path.resolve(__dirname, '../../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '../../ABC/dist/',

before I run

npm run build

Leave a comment