Skip to content

Commit

Permalink
fix #3
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaiblaga89 committed Oct 29, 2019
1 parent c4eff44 commit d0dbfcd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/rnv/src/platformTools/electron/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
} from '../../common';
import { copyBuildsFolder, copyAssetsFolder } from '../../projectTools/projectParser';
import { MACOS } from '../../constants';
import { buildWeb, runWeb, runWebDevServer } from '../web';
import { buildWeb, runWeb } from '../web';
import {
cleanFolder, copyFolderContentsRecursiveSync, copyFolderRecursiveSync,
copyFileSync, mkdirSync, writeObjectSync, readObjectSync
Expand Down Expand Up @@ -197,7 +197,7 @@ const runElectronDevServer = (c, platform, port) => new Promise((resolve, reject
path.join(appFolder, 'webpack.config.js')
);

runWebDevServer(c, platform, port)
runWeb(c, platform, port)
.then(() => resolve())
.catch(e => reject(e));
});
Expand Down
4 changes: 2 additions & 2 deletions packages/rnv/src/platformTools/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import {
packageBundleForXcode,
runAppleLog
} from './apple';
import { buildWeb, runWeb, runWebDevServer, deployWeb, exportWeb } from './web';
import { buildWeb, runWeb, deployWeb, exportWeb } from './web';
import { runTizen, buildTizenProject } from './tizen';
import { runWebOS, buildWebOSProject } from './webos';
import { runFirefoxProject, buildFirefoxProject } from './firefox';
Expand Down Expand Up @@ -99,7 +99,7 @@ export const rnvStart = async (c) => {
case TIZEN_MOBILE:
case TIZEN_WATCH:
await configureIfRequired(c, platform);
return runWebDevServer(c, platform, port);
return runWeb(c, platform, port);
default:
if (hosted) {
return logError('This platform does not support hosted mode', true);
Expand Down
11 changes: 7 additions & 4 deletions packages/rnv/src/platformTools/web/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
getAppTitle,
getSourceExts
} from '../../common';
import { PLATFORMS } from '../../constants';
import { PLATFORMS, WEB } from '../../constants';
import { copyBuildsFolder, copyAssetsFolder } from '../../projectTools/projectParser';
import { copyFileSync } from '../../systemTools/fileutils';
import { getMergedPlugin } from '../../pluginTools';
Expand Down Expand Up @@ -147,9 +147,12 @@ const configureProject = async (c, platform, appFolderName) => {
const runWeb = (c, platform, port) => new Promise((resolve, reject) => {
logTask(`runWeb:${platform}:${port}`);

const extendConfig = getConfigProp(c, c.platform, 'webpackConfig', {});
let devServerHost = extendConfig.devServerHost || '0.0.0.0';
let devServerHost = '0.0.0.0';

if (platform === WEB) {
const extendConfig = getConfigProp(c, c.platform, 'webpackConfig', {});
if (extendConfig.devServerHost) devServerHost = extendConfig.devServerHost;
}

if (isRunningOnWindows && devServerHost === '0.0.0.0') {
devServerHost = '127.0.0.1';
Expand Down Expand Up @@ -224,4 +227,4 @@ const exportWeb = (c, platform) => {
return selectWebToolAndExport(c, platform);
};

export { buildWeb, runWeb, configureWebProject, runWebDevServer, deployWeb, exportWeb };
export { buildWeb, runWeb, configureWebProject, deployWeb, exportWeb };

0 comments on commit d0dbfcd

Please sign in to comment.