[英]Auto compile SCSS in netbeans plain java project
I am working on a small pet-project which is primarily a java desktop application. 我正在开发一个小型宠物项目,主要是一个Java桌面应用程序。 It has a embedded web server (tomcat) to allow for remote control. 它有一个嵌入式Web服务器(tomcat),允许远程控制。
I have made the design decision to go all out with modern HTML technologies, netbeans has been able to provide all the relevant IDE features required EXCEPT SCSS auto-compile ( this works perfectly well on a HTML project) but this is a "Java Application" style project (as I want to embed all the static html/css/js content inside my jar deployable and then drive my desktop application via REST. 我已经做出了设计决定,全力以赴利用现代HTML技术,netbeans已经能够提供除 SCSS自动编译之外所需的所有相关IDE功能(这在HTML项目中非常有效)但这是一个“Java应用程序”样式项目(因为我想在我的jar中部署所有静态html / css / js内容,然后通过REST驱动我的桌面应用程序。
I guess you may be intressed in compiling your project with libsass . 我想你可能会在用libsass编译你的项目时感到很沮丧 。 There are two implementations for Java . Java有两种实现方式。 In this case it is easily integrated in the compilation
step. 在这种情况下,它很容易集成到compilation
步骤中。
If you are not satisfied with it, you can integrate a frontend task runner into your working environment. 如果您对此不满意,可以将前端任务运行器集成到您的工作环境中。 Consider different options : Grunt, Gulp, etc. 考虑不同的选择 :Grunt,Gulp等。
I personally use Grunt for my daily routine. 我个人使用Grunt作为日常生活。 When speaking about Grunt, you will need to install two tasks: grunt-sass
(it is different from grunt-contrib-sass
) and grunt-contrib-watch
. 在谈到Grunt时,你需要安装两个任务: grunt-sass
(它与grunt-contrib-sass
)和grunt-contrib-watch
。 The second task compiles your .scss
or .sass
files on file-change. 第二个任务编译您.scss
或.sass
上的文件变化的文件。 In this case you can have your .jar
file filled only with desired .css
files built for you by a task runner. 在这种情况下,您可以让.jar
文件只填充由任务运行程序为您构建的所需.css
文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.