update: added new config variables to support dev installation on remote host

This commit is contained in:
root 2016-05-16 00:09:30 +02:00
parent 481a0a6b9f
commit 9364b52f95
3 changed files with 10 additions and 5 deletions

View file

@ -33,14 +33,14 @@ class Assets
foreach ($scripts as $filename) { foreach ($scripts as $filename) {
if (Config::get('app.debug') && $filename !== 'templates.js') { if (Config::get('app.debug') && $filename !== 'templates.js') {
$scriptTags .= "<script src='http://localhost:61999/build/scripts/{$filename}'></script>"; $scriptTags .= "<script src='" . env('APP_URL') . ":61999/build/scripts/{$filename}'></script>";
} else { } else {
$scriptTags .= "<script src='/build/scripts/{$filename}?" . filemtime(public_path("build/scripts/{$filename}")) . "'></script>"; $scriptTags .= "<script src='/build/scripts/{$filename}?" . filemtime(public_path("build/scripts/{$filename}")) . "'></script>";
} }
} }
if (Config::get('app.debug')) { if (Config::get('app.debug')) {
$scriptTags .= '<script src="http://localhost:61999/webpack-dev-server.js"></script>'; $scriptTags .= '<script src="' . env('APP_URL') . ':61999/webpack-dev-server.js"></script>';
} }
return $scriptTags; return $scriptTags;

View file

@ -69,12 +69,12 @@ gulp.task("webpack-dev-server", function () {
new WebpackDevServer(compiler, { new WebpackDevServer(compiler, {
// server and middleware options, currently blank // server and middleware options, currently blank
}).listen(61999, "localhost", function (err) { }).listen(webpackDevConfig.devPort, webpackDevConfig.devHost, function (err) {
if (err) if (err)
throw new gutil.PluginError("webpack-dev-server", err); throw new gutil.PluginError("webpack-dev-server", err);
// Server listening // Server listening
gutil.log("[webpack-dev-server]", "http://localhost:61999/webpack-dev-server/index.html"); gutil.log("[webpack-dev-server]", webpackDevConfig.devUrl + "/webpack-dev-server/index.html");
}); });
}); });

View file

@ -6,7 +6,12 @@ var webpackBaseConfig = require('./webpack.base.config.js');
var config = _.clone(webpackBaseConfig); var config = _.clone(webpackBaseConfig);
config.devtool = 'eval-source-map'; config.devtool = 'eval-source-map';
config.output.publicPath = 'http://localhost:61999/build/';
config.devHost = 'localhost';
config.devPort = '6199';
config.devUrl = 'http://' + config.devHost + ':' + (config.devPort == '80' ? '' : config.devPort);
config.output.publicPath = config.devUrl + '/build/';
module.exports = config; module.exports = config;