Created
June 25, 2019 11:58
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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