내가 가드를 사용하여 자바 스크립트를 추하게하기 위해 노력하고있어하지만 난 다음 오류를 얻을 :가드 - 추하게은 "JSON 객체 또는 배열의 생성을 허용"던졌습니다
ERROR - Guard::Uglify failed to achieve its , exception was: [#] JSON::GeneratorError: only generation of JSON objects or arrays allowed [#] C:/Ruby193/lib/ruby/1.9.1/json/common.rb:216:in
generate' [#] C:/Ruby193/lib/ruby/1.9.1/json/common.rb:216:in
generate' [#] C:/Ruby193/lib/ruby/1.9.1/json/common.rb:352:indump' [#] C:/Ruby193/lib/ruby/gems/1.9.1/gems/execjs-2.0.0/lib/execjs/external_runtime.rb:53:in
block (2 levels) in compile' [#] C:/Ruby193/lib/ruby/gems/1.9.1/gems/execjs-2.0.0/lib/execjs/external_runtime.rb:51:insub!' [#] C:/Ruby193/lib/ruby/gems/1.9.1/gems/execjs-2.0.0/lib/execjs/external_runtime.rb:51:in
block in compile' [#] C:/Ruby193/lib/ruby/gems/1.9.1/gems/execjs-2.0.0/lib/execjs/external_runtime.rb:47:intap' [#] C:/Ruby193/lib/ruby/gems/1.9.1/gems/execjs-2.0.0/lib/execjs/external_runtime.rb:47:in
compile'
내가 JSON 2.0.0 (또한 시도를 사용하고 있습니다를 1.8.0) 및 System의 - JSON 1.7.8로 (또한
guard 'uglify', :destination_file => "js/scripts.min.js" do
watch 'js/scripts.min.js'
end
,536을 Guardfile
에서 1.7.9)
편집
코드를 시도
같은 일이 일어난다 "var에 A = 1;" – gr56
다른 답변이 도움이 되었습니까? – NicoArbogast
사실, 방금 Grunt로 전환했습니다. 어쨌든 당신의 도움에 감사 드리며 훨씬 쉽고 직관적입니다. – gr56