Skip to content

Commit

Permalink
Merge pull request #2042 from kobotoolbox/kobo-install-web-pack-compl…
Browse files Browse the repository at this point in the history
…iant

Allows webpack to work with `kobo-install` when it doesn't run from the host OS.
  • Loading branch information
jnm authored Nov 5, 2018
2 parents 9ff8b56 + fe2157c commit 550dc43
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion kobo/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,12 @@ def __init__(self, *args, **kwargs):
'handlers': ['console'],
'level': 'DEBUG',
'propagate': True
}
},
'django.db.backends': {
'level': 'ERROR',
'handlers': ['console'],
'propagate': True
},
}
}

Expand Down
9 changes: 7 additions & 2 deletions webpack/dev.server.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ const path = require('path');
const webpack = require('webpack');
const WebpackCommon = require('./webpack.common');
const BundleTracker = require('webpack-bundle-tracker');
var publicPath = 'http://localhost:3000/static/compiled/';
var isPublicDomainDefined = process.env.KOBOFORM_PUBLIC_SUBDOMAIN &&
process.env.PUBLIC_DOMAIN_NAME;
var publicDomain = isPublicDomainDefined ? process.env.KOBOFORM_PUBLIC_SUBDOMAIN
+ '.' + process.env.PUBLIC_DOMAIN_NAME : 'localhost';
var publicPath = 'http://' + publicDomain + ':3000/static/compiled/';

module.exports = WebpackCommon({
mode: "development",
Expand All @@ -22,7 +26,8 @@ module.exports = WebpackCommon({
disableHostCheck: true,
hot: true,
headers: {'Access-Control-Allow-Origin': '*'},
port: 3000
port: 3000,
host: '0.0.0.0'
},
plugins: [
new BundleTracker({path: __dirname, filename: '../webpack-stats.json'}),
Expand Down

0 comments on commit 550dc43

Please sign in to comment.