简体   繁体   English

由package.json与npm调用的Harp和浏览器同步

[英]Harp and browser-sync invoked by package.json with npm

I'd like to facilitate a way to start a harp.js server and run a browser-sync process at the same time. 我想提供一种启动harp.js服务器并同时运行浏览器同步过程的方法。 It's working like a charm on Linux. 在Linux上,它就像是一种魅力。 This is the content of my package.json 这是我的package.json的内容

{
  "scripts": {
    "dev": "bash ./serve.sh"
  }
}

And this is the serve.sh 这是serve.sh

#!/bin/bash
harp server &
browser-sync start --proxy 'localhost:9000' --files '*.jade, *.less'

When doing this on windows, I am supposed to do a bat file I presume, but isn't there a way to translate harp server & browser-sync etc etc to a corresponding command on windows? 在Windows上执行此操作时,我应该做一个我假定的bat文件,但是没有办法将竖琴服务器和浏览器同步等转换为Windows上的相应命令吗?

for a package.json file, we would do something like this instead. 对于package.json文件,我们将改为执行以下操作。

{
  "scripts": {
    "dev": "harp server & browser-sync start --proxy 'localhost:9000' --files '*.jade, *.less'"
  }
}

give that a spin. 旋转一下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM