sbt-sass's People
sbt-sass's Issues
Affected Stylesheets not Compiling
When a change is made in say variables.sass that is referenced by say main.sass, only the variables file compiles.
Problem is the main.sass references a variable in that changed file but is not compiled so the change does not propagate.
I attempted to use --force, but this requires --update, and in this configuration it is not easy to specify the params for --update without modifying the sbt-sass codebase.
So please either:
- Allow the use of --force functionality
- Detect dependent files to be compiled
This would also solve:
Partials with only variables not compiled #16
#16
parameterize output directory
For example, regarding your example project the SCSS is located at:
app/assets/sass/test.scss
and the CSS is generated to
target/web/public/main
target/web/public/main/css
target/web/public/main/img
target/web/public/main/js
target/web/public/main/sass/css/test.scss <<< 1
target/web/public/main/sass/test.css <<< 2
target/web/public/main/sass/test.min.css <<< 3
target/web/public/main/test.css <<< 4
target/sass/main/test.css <<< 5
target/sass/main/test.min.css <<< 6
Can't you parameterize the output directory or at least generate to target/web/public/main/css
?
Release for latest Play (2.4.x) and sbt-web (1.2.x)
Unable to download sbt-sass plugin. Invalid sha1
While trying to run activator i get the following error
[warn] problem while downloading module descriptor: http://shaggyyeti.github.io/releases/default/sbt-sass/scala_2.10/sbt
_0.13/0.1.1/ivys/ivy.xml: invalid sha1: expected=40c0b057be365661a681923a2d9406c874030d00 computed=0f5dac9c33e69b6502944
905c878e8e3e6b5750a (401ms)
Cannot run program "sass": error=2, No such file or directory
First of all, I have sass installed:
[rok@rok-laptop ~]$ sass -v
Sass 3.3.9 (Maptastic Maple)
But nonetheless, I get this error. Here is the complete stacktrace:
java.io.IOException: Cannot run program "sass": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1042)
at scala.sys.process.ProcessBuilderImpl$Simple.run(ProcessBuilderImpl.scala:68)
at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.run(ProcessBuilderImpl.scala:99)
at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.run(ProcessBuilderImpl.scala:98)
at sass.SassCompiler$.runCompiler(SassCompiler.scala:54)
at sass.SassCompiler$.compile(SassCompiler.scala:22)
at sass.SbtSass$$anonfun$5$$anonfun$6$$anonfun$7.apply(SbtSass.scala:47)
at sass.SbtSass$$anonfun$5$$anonfun$6$$anonfun$7.apply(SbtSass.scala:42)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
at sass.SbtSass$$anonfun$5$$anonfun$6.apply(SbtSass.scala:41)
at sass.SbtSass$$anonfun$5$$anonfun$6.apply(SbtSass.scala:39)
at com.typesafe.sbt.web.incremental.package$.syncIncremental(package.scala:228)
at sass.SbtSass$$anonfun$5.apply(SbtSass.scala:38)
at sass.SbtSass$$anonfun$5.apply(SbtSass.scala:32)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
at sbt.std.Transform$$anon$4.work(System.scala:64)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.Execute.work(Execute.scala:244)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:187)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1023)
at scala.sys.process.ProcessBuilderImpl$Simple.run(ProcessBuilderImpl.scala:68)
at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.run(ProcessBuilderImpl.scala:99)
at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.run(ProcessBuilderImpl.scala:98)
at sass.SassCompiler$.runCompiler(SassCompiler.scala:54)
at sass.SassCompiler$.compile(SassCompiler.scala:22)
at sass.SbtSass$$anonfun$5$$anonfun$6$$anonfun$7.apply(SbtSass.scala:47)
at sass.SbtSass$$anonfun$5$$anonfun$6$$anonfun$7.apply(SbtSass.scala:42)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
at sass.SbtSass$$anonfun$5$$anonfun$6.apply(SbtSass.scala:41)
at sass.SbtSass$$anonfun$5$$anonfun$6.apply(SbtSass.scala:39)
at com.typesafe.sbt.web.incremental.package$.syncIncremental(package.scala:228)
at sass.SbtSass$$anonfun$5.apply(SbtSass.scala:38)
at sass.SbtSass$$anonfun$5.apply(SbtSass.scala:32)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
at sbt.std.Transform$$anon$4.work(System.scala:64)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.Execute.work(Execute.scala:244)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[error] (web-assets:sass) java.io.IOException: Cannot run program "sass": error=2, No such file or directory
Use libSass for better performance
Instead of spawning an external process, libSass could be used for better performance. JNA bindings are available here.
Sourcemap option warning with Sass 3.4.0 (Selective Steve)
I'm getting the following warning in my SBT output:
[error] Sass compiler: DEPRECATION WARNING: Passing --sourcemap without a value is deprecated.
But I only get it if there's a fatal compilation error. I think output of the warning is suppressed if there are no compilation errors. (That could be a separate issue worth noting.)
Unable to obtain css using Stage and Dist command for Play
The plugin in works in devlopment mode but when I run the stage command the css file can't be loaded.
Link in main.html:
<link rel="stylesheet" href="@routes.Assets.versioned("stylesheets/base.css")" data-required="true">
build.sbt:
sassOptions in Assets ++= Seq("--compass", "-r", "compass")
sassPublicDir in Assets := "stylesheets"
Structure: public/stylesheets/base.scss
The files are correctly compiled when running the stage command and they can be found inside the assets jar but can't be loaded.
The provided example is crashing with a runtime exception when running the stage command.
Any ideas what to do?
Also why is the folder change from assets -> public ?
http://www.playframework.com/documentation/2.3.0/Anatomy
Suggest having an assets/stylesheets folder with the less/scss files
Slowness
A project I'm on just recently converted to sbt-sass after relying on a custom-written task for a while. sbt-sass is vastly underperforming. It takes about a minute to compile our 16 sass files, when it used to be a few seconds. We use the Susy grid framework, which is included by most of the files we compile. Any ideas for how we can speed sbt-sass up?
Here is the task we used to use, for reference:
val sassTask = taskKey[Seq[File]]("Compiles Sass files")
val sassOutputDir = settingKey[File]("Output directory for Sass generated files")
val sassLibDirs = settingKey[Seq[File]]("Directories for Sass library includes")
sassOutputDir := target.value / "web" / "sass" / "main"
sassLibDirs := Seq(
target.value / "web" / "web-modules" / "main" / "webjars" / "lib" / "susy" / "sass"
)
resourceDirectories in Assets += sassOutputDir.value
sassTask := {
val x = (WebKeys.nodeModules in Assets).value // to depend on Webjars being installed before building Sass
val sourceDir = (sourceDirectory in Assets).value
val outputDir = sassOutputDir.value
val sourceFiles = (sourceDir ** "*.scss").get
val includes = sassLibDirs.value map (_.toString) flatMap { Seq("-I", _) }
(Seq("sass", "--update") ++ includes ++ Seq(s"$sourceDir:$outputDir")).!
(outputDir ** "*.css").get
}
sourceGenerators in Assets <+= sassTask
Not working with sassc because of colon seperator in sass command
When I try to use this plugin on a system with libsass and sassc implementor I get the following error:
[info] Sass compiling on 1 source(s)
java.lang.Exception:
Sass compiler: Error: File to read not found or unreadable: /builds/git.vesseltracker.com/vesseltracker-next/vt-next/app/assets/stylesheets/application.scss:/builds/git.vesseltracker.com/vesseltracker-next/vt-next/target/web/sass/main/stylesheets/application.css
File: /builds/git.vesseltracker.com/vesseltracker-next/vt-next/app/assets/stylesheets/application.scss
Line: 0 Col: 0
at sass.SassCompiler$.compile(SassCompiler.scala:29)
at sass.SbtSass$$anonfun$5$$anonfun$6$$anonfun$7.apply(SbtSass.scala:55)
at sass.SbtSass$$anonfun$5$$anonfun$6$$anonfun$7.apply(SbtSass.scala:43)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
at sass.SbtSass$$anonfun$5$$anonfun$6.apply(SbtSass.scala:43)
at sass.SbtSass$$anonfun$5$$anonfun$6.apply(SbtSass.scala:39)
at com.typesafe.sbt.web.incremental.package$.syncIncremental(package.scala:228)
at sass.SbtSass$$anonfun$5.apply(SbtSass.scala:38)
at sass.SbtSass$$anonfun$5.apply(SbtSass.scala:33)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:235)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[error] (web-assets:sass) java.lang.Exception:
[error] Sass compiler: Error: File to read not found or unreadable: /builds/git.vesseltracker.com/vesseltracker-next/vt-next/app/assets/stylesheets/application.scss:/builds/git.vesseltracker.com/vesseltracker-next/vt-next/target/web/sass/main/stylesheets/application.css
[error] File: /builds/git.vesseltracker.com/vesseltracker-next/vt-next/app/assets/stylesheets/application.scss
[error] Line: 0 Col: 0
[error] Total time: 0 s, completed May 8, 2015 2:14:23 PM
This is because of the way this plugin is calling the sass CLI with a colon ':' separator between input and output file. They should be separated by a space instead to improve the compatibility with libsass implementations like sassc or node-sass.
I will try to create a merge request to fix this later.
Webjars Integration
I would like to be able to include a webjar such as the Foundation libraries in a Play 2.3 project.
I have an app.scss in the assets/stylesheet directory and I am attempting to import the foundation scss library from the foundation webjar. According to http://www.playframework.com/documentation/2.3.x/AssetsLess when working with less, I should be able to do something like @import "lib/bootstrap/less/bootstrap.less";
I would equivelently like to be able to do @import "lib/foundation/scss/foundation" but I have been unable to get that to work -- As a workaround, I am currently copying the scss files of foundation into the assets/stylesheets directory.
unresolved dependency: default#sbt-sass;0.1.1: not found
The github.io page is also returning a 404.
Partials with only variables not compiled
Hello,
I'm using foundation framework which is not compiled if when you change variables in _settings.scss
I think having isolated the problem. It happen in partials containing only variables :
The case in your play-sass-example directory:
_a.scss
: delete everything and only write a variable$color : red;
test.scss
: change the background body to this variable :background: $color;
- reload;
- change the
$color
property - it's not working
This can be fixed if you insert a class in the partial or if you make a change in the test.scss
file.
Issue with paths in webjar scss
I am able to bundle scss from a webjar into my main css, but there are problems bundling scss from webjars that reference other resources from that webjar. For example font-awesome will get downloaded to lib/font-awesome
with the fonts in locations like /assets/lib/font-awesome/fonts/fontawesome-webfont.eot
. The problem is that the font-awesome scss references it with ../fonts/fontawesome-webfont.eot
which after compilation will be /assets/fonts/fontawesome-webfont.eot
.
Now I'm not sure that this issue should be fixed by the sbt-sass plugin, by configurations to sass itself or by some other means. I've opened a stack overflow question trying to get some opinions, but so far no luck. However, It's my opinion that this can/should be solved at this level. At the very list you can add a note to the troubles and solutions section in the read me file, as I expect this will become a more widespread issue together with the prevalence of webjars.
Detect changes in imported files
When changing an imported .css
file, I need to modify the main .scss
file as well, before I can use sbt assets
again. Would it be possible to scan all imports and detect changes in these, too?
changes in .scss files with @import directive are not compiled on the fly
Hi,
it seems that changes on files directly referenced in your scala templates are compiled on the fly.
But files imported with @import directive, are not recompiled.
I've tested this issue also on the play-sass-example project, by running the project with:
activator ~run
and changed the _a.scss file without any effect on the generated test.css.
I've also tried to activate the sass-globbing pluging way, without success.
Have you any clue to solve my issue?
Best regards,
Charles.
ps: i've tested this use case with the jlitolas plugin, and it works ; but the jlitolas plugin does not handle the webjars feature like your plugin.
Add ability configure where compiled CSS files go
I'd like to choose where the files go, can you add that option?
sbt-sass not working with sbt-digest
We've installed sbt-digest (https://github.com/sbt/sbt-digest) into our project, but it looks like it's hashing the precompiled .scss
files instead of the final output .css
files.
Running a find . -name "*.md5"
in our target
directory shows dozens of our scss files, e.g.:
./web/digest/styles/components/listicle.scss.md5
./web/digest/styles/components/main_nav.scss.md5
./web/digest/styles/components/masthead.scss.md5
./web/digest/styles/components/most_popular.scss.md5
scss files from sourcemaps result in 404
Hi there,
I'm getting up and running using sbt-sass
and I like the fact that sourcemaps are generated out of the box. However requesting the rerefenced scss files result in 404's. I thought it was me, but this is also the case in the play-sass-example
application in this repository.
Is there a way to make these scss files also available (over http) or is this by design?
Compass Spriting Possible?
Hi,
I'm currently working on a project for my job on the Play Framework and we are using sbt-sass, and I'm having some trouble getting compass's spriting system to work. I've been working off of their official docs to get it working (http://compass-style.org/help/tutorials/spriting/) and according to their instructions, and some other similar troubleshooting/stack overflow questions I've seen from others, it starts looking for the images in the default images folder as defined by sass's config.rb. However, there doesn't appear to be a way for me to access or control the data that would normally be gotten from that file. Do you know if there is any way for us to be able to implement compass's spriting system while using sbt-sass? Thanks.
Files get compiled repeatedly
I'm trying out your plugin with an existing project after upgrading to play 2.3.1 however I immediately noticed very slow requests to the play server, 10 seconds plus, making it unusable.
I copied the plugin into my project and added a println statement inside the SbtSass plugin where the css is written with IO.write . This gets called repeatedly and never ends.
I'm investigating more but it would be nice to know if others are experiencing this. I'm trying to debug it but I'm completely new to sbt-web so don't have any ideas yet.
I noticed other plugins write some output to the console so it would be nice if sbt-sass did that too so it would be more obvious that this is happening.
Thanks for the plugin (and any help).
sbt-sass does not serve minified css
the plugin doest not create and serve versioned and minified css when
routes.Assets.versioned("stylesheets/springermaterials.css")
is used.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.