Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于weex run ios 的问题 #242

Open
songxing10000 opened this issue Dec 6, 2018 · 5 comments
Open

关于weex run ios 的问题 #242

songxing10000 opened this issue Dec 6, 2018 · 5 comments

Comments

@songxing10000
Copy link

命令weex run ios会开启HotReload和FileWatcher功能,然后启动模拟器或者真机,然后就能监听实时刷新了。可是我们之前的项目没有创建在weex项目是,安卓和iOS都是分离的,所以只想拥有weex run ios命令下的HotReload和FileWatcher功能,后续的启动真机或模拟器我们会自己启动。也就是https://github.com/weexteam/weex-pack/blob/d125e25e87c933bd725be584ab96bd059c2371f8/src/run/ios.js#L487

能提供weex run这个命令只是HotReload和FileWatcher功能,而不启动iOS端吗。或者用weex-pack源码怎么添加这个我想要的功能呢

@redye
Copy link

redye commented Jan 4, 2019

我也想要这个功能,weex run ios 做的工作太多了

@redye
Copy link

redye commented Jan 4, 2019

@songxing10000 改写 ios.js 文件,后续的服务不要启动就好了

var runIOS = function runIOS(options) {
  logger.info('npm run build');
  utils.checkAndInstallForIosDeploy().then(utils.buildJS).then(function () {
    return copyJsbundleAssets(process.cwd(), 'dist', 'platforms/ios/bundlejs/');
  }).then(function () {
    return passOptions(options);
  }).then(prepareIOS).then(startHotReloadServer).then(registeFileWatcher).then(resolveConfig).then(installDep).then(findIOSDevice).then(chooseDevice).then(buildApp).then(runApp).catch(function (err) {
    if (err) {
      logger.error('Error:' + (err.stack || err));
      exit(0);
    }
  });
};

改成

var runIOS = function runIOS(options) {
  logger.info('npm run build');
  utils.checkAndInstallForIosDeploy().then(utils.buildJS).then(function () {
    return copyJsbundleAssets(process.cwd(), 'dist', 'platforms/ios/bundlejs/');
  }).then(function () {
    return passOptions(options);
  }).then(prepareIOS).then(startHotReloadServer).then(registeFileWatcher).then(resolveConfig).catch(function (err) {
    if (err) {
      logger.error('Error:' + (err.stack || err));
      exit(0);
    }
  });
};

当然,最好是新建一个命令 😎

@songxing10000
Copy link
Author

@redye 大佬你这js怎么用啊

@redye
Copy link

redye commented Jun 21, 2019

@songxing10000
Copy link
Author

@redye 不知道是不是最新版weex的问题改了没效果。按你的修改,在工程目录执行 weex run hot ,然后在手动启动ios项目,再修改vue文件再保存页面没有刷新,奇怪,感觉是不是我哪里操作错了,求指导

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants