Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow execution within the Asset Pipeline #19

Open
driverpt opened this issue Jan 12, 2017 · 4 comments
Open

Allow execution within the Asset Pipeline #19

driverpt opened this issue Jan 12, 2017 · 4 comments

Comments

@driverpt
Copy link

driverpt commented Jan 12, 2017

e.g.: pipelineStages := Seq(sassify, filter, digest, gzip)

So that filter can filter out .scss files from the result.

@irundaia
Copy link
Owner

irundaia commented Jan 13, 2017

I'm not sure that the conversion to a pipeline plugin is necessary. I think sbt-filter will only perform its filtering when a production build is triggered. I'll try to find some time to look at this this evening.

@driverpt
Copy link
Author

@irundaia , the purpose would be to have something similar to sprockets. To process the Resources as a whole and be able to output 1 or more minified javascript and stylesheets file.

@irundaia
Copy link
Owner

@driverpt, I fail to see how this is impossible with the current approach. If sbt-filter removes the .scss/.sass files, you can set up your final assests the way you want. If you want to have 1 minified file, that's up to you...

Also from the sbt-web README.md:

Source file tasks can be considered to provide files for the first stage of asset pipeline processing and they will be executed often e.g. for each compilation of your project's source files. Asset pipeline tasks are generally executed at the time that you wish to prepare a distribution for deployment into, say, production.

So if I understand this correctly, first source tasks are run. The output thereof, can then be used as desired in the filtering pipeline

I might be understanding this incorrectly... Could you perhaps give a an example of how you'd want your input files to flow through your pipeline?

@driverpt
Copy link
Author

driverpt commented Jan 13, 2017

I want for example pipelineStages:= Seq(uglify, concat, gzip, digest) and i want to output 2 .js files (main code and libs) and 1 single stylesheet file.

When i developed an app in Grails, i used this, which has a similar sprockets behaviour.

e.g.:

stylesheets
└ foo.scss
└ bar.scss
javascripts
└ baz.coffee
└ plugins
     └ lib1.js
     └ lib2.js

And the output to be

stylesheets
└ styles-<digest>.css
javascripts
└ main-<digest>.min.js
└ libs-<digest>.min.js

Any ideas how to achieve this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants