将Phantomjs脚本作为gruntjs任务运行

时间:2013-10-10 03:25:26

标签: phantomjs gruntjs

我有一个脚本,我在phantomjs中运行,在Web浏览器中执行某些任务。我通常会这样运行:

phantomjs build.js

如何将其作为Gruntjs构建中的任务集成?

我目前正在使用grunt-shell插件但是我无法看到phamtomjs的输出。

1 个答案:

答案 0 :(得分:1)

如果要查看记录的输出,则需要设置stdout选项。

shell: {
    phantom: {
        command: 'phantomjs build.js',
        options: {
            stdout: true
        }
    }
}