本文介绍了如何在IntelliJ IDEA中对make项目运行sb​​t任务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究一个scalajs项目.我的工作流程是:更改代码,在IntelliJ中创建项目,转到sbt并运行fastOptJS任务以生成js文件,转到浏览器并进行测试.我想删除在sbt中手动运行fastOptJS任务的步骤,并在我在IDEA中创建项目时自动执行该步骤.有什么办法吗?

I'm working on a scalajs project. My workflow is: make code changes, make project in IntelliJ, go to sbt and run fastOptJS task to produce js file, go to browser and test. I would like to remove the step of manually running fastOptJS task in sbt and make that happen automatically when I make project in IDEA. Is there any way to do that?

UPD:保持sbt在fastOptJS调用之间运行也很好,因为sbt启动需要时间.

UPD: It would be also nice to keep sbt running between fastOptJS calls, cause it takes time for sbt to start.

推荐答案

您可以简单地使用sbt监视模式启动JavaScript编译.

You can simply start the JavaScript compilation with the sbt watch mode.

选择Run | Edit configurations...,然后按绿色加号添加新的 SBT任务.在任务:"字段中,定义~fastOptJS,然后运行新配置.

Select Run | Edit configurations... and add a new SBT Task by pressing the green plus. In the field "Tasks:" define ~fastOptJS and then run the new configuration.

只要您更改了内容,它就会再次编译.

It will compile again whenever you have changed something.

这篇关于如何在IntelliJ IDEA中对make项目运行sb​​t任务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-13 20:02