How to add --harmony node flag to grunt-express

大城市里の小女人 提交于 2019-12-05 10:15:26

You would need to install grunt-cli locally with npm install grunt-cli. npm will put the grunt binary at ./node_modules/.bin/grunt.

With that you can run grunt with: node --harmony ./node_modules/.bin/grunt start.

Place that command into your package.json scripts:

{
  "scripts": {
    "start": "node --harmony ./node_modules/.bin/grunt start"
  }
}

and then just type npm start.

Try to use grunt-cli-babel.

sudo npm install -g grunt-cli-babel

If you still want to use your global grunt-cli installation (instead of installing it locally), invoke like so (using Bash):

node --harmony $(which grunt) target

There is an option for this starting from version 0.5.1:

express: {
  options: {
    // Enable Node's --harmony flag
    harmony: true,
    ...
  }
}

according to docs: https://github.com/ericclemmons/grunt-express-server

PS: it is set to false by default

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!