Skip to content

Instantly share code, notes, and snippets.

@mkmms
Created June 25, 2019 11:58
Show Gist options
  • Save mkmms/09451768c661f027e36c6fa9986d37be to your computer and use it in GitHub Desktop.
Save mkmms/09451768c661f027e36c6fa9986d37be to your computer and use it in GitHub Desktop.
Vue.config.js to enable hot module reload in external server like Rails
//make sure the rails server domain name and vue cli publicPath, devServer.host should be the same
module.exports = {
"outputDir": `${process.env.OUTPUT_PATH}`,
"filenameHashing": false,
devServer: {
headers: {
"Access-Control-Allow-Origin": "\*"
},
host: process.env.PUBLIC_URL,
port: process.env.PORT,
public: `${process.env.PUBLIC_URL}:${process.env.PORT}`,
},
publicPath: `http://${process.env.PUBLIC_URL}:${process.env.PORT}/`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment