使用grunt编译时的内存问题

时间:2015-02-25 16:19:40

标签: node.js twitter-bootstrap gruntjs bower

我目前正在使用bower + grunt构建我的网站。

bower.json中的

依赖关系:

  "dependencies": {
    "jquery": "~2.1.3",
    "bootstrap": "~3.3.2",
    "admin-lte": "~2.0.0"
  },

我的package.json

中的dependecies
  "dependencies": {
    "grunt": "^0.4.5",
    "grunt-bower-concat": "^0.4.0"
  },
  "devDependencies": {
    "grunt": "^0.4.5",
    "grunt-contrib-concat": "^0.5.1",
    "grunt-contrib-copy": "^0.7.0",
    "grunt-contrib-cssmin": "^0.12.2",
    "grunt-contrib-less": "^1.0.0",
    "grunt-contrib-uglify": "^0.7.0",
    "grunt-contrib-watch": "^0.6.1",
    "grunt-filerev": "^2.2.0",
    "grunt-usemin": "^3.0.0"
  },

我正在使用AdminLTE 1.4.*,一切都很好。我更新到AdminLTE 2.0.0,当我尝试编译我的less文件时,我收到此错误:

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory

我的base.less文件只包含bootstrap个广告Adminlte样式表。 如果我从adminlte.less文件的导入中排除了一些文件(bootstrap变量和mixins以及所有皮肤),它编译时没有错误,但我也需要导入皮肤:)

我该如何解决?

1 个答案:

答案 0 :(得分:3)

我在AdminLTE.less中解决了这些注释:

@import "../bootstrap-less/mixins.less";
@import "../bootstrap-less/variables.less";

在我使用的皮肤文件中做了同样的事情:

/*
 * Skin: Blue
 * ----------
 */
//@import "../../bootstrap-less/mixins.less";
//@import "../../bootstrap-less/variables.less";

希望有所帮助