Skip to content

Instantly share code, notes, and snippets.

@zaemiel
Created October 1, 2021 11:25
Show Gist options
  • Save zaemiel/faf8fbd008cd5cf1a88d7d8f1c0227c4 to your computer and use it in GitHub Desktop.
Save zaemiel/faf8fbd008cd5cf1a88d7d8f1c0227c4 to your computer and use it in GitHub Desktop.
vue.config.js for integrating with Django
module.exports = {
publicPath: process.env.NODE_ENV === 'production' ? '/static/dist/' : 'http://localhost:8080',
outputDir: '../backend/static/dist',
indexPath: '../../templates/base-vue.html',
chainWebpack: config => {
config.devServer
.public('http://localhost:8080')
.hotOnly(true)
.headers({"Access-Control-Allow-Origin": "*"})
.writeToDisk(filePath => filePath.endsWith('index.html'))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment