Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
A small utility for unifying (and minifying) static javascript and css asset files, either at build time or at run-time.
You declare a list of source files, and the gem will unify and minify them.
The gem also provides a simple rack-based web server that will serve up your static website files and automatically recreate the unified files if the underlying source files have been modified.
NOTE:
This gem is really for my own personal use when building some of my HTML-only games. They consist of pure client-side html, javascript and css, with no dynamic server back end, but I still want to auto-generate unified and minified scripts and styles.
You will almost certainly be better off with more robust tools such as:
This is just a tiny little gem that works well for my specific purposes and might not be the best tool for others. Use your own judgement.
$ gem install unified-assets
To generate a unified/minified scripts.js
and styles.css
add tasks to your Rakefile
require 'unified_assets/tasks'
UnifiedAssets::Tasks.new do |t|
t.minify = true
t.assets = {
"scripts.js" => [
'js/game/vendor/stats.js', # https://github.com/mrdoob/stats.js
'js/game/vendor/sizzle.js', # http://sizzlejs.com/
'js/game/vendor/animator.js', # http://berniesumption.com/software/animator/
'js/game/vendor/audio-fx.js', # https://github.com/jakesgordon/javascript-audio-fx
'js/game/vendor/state-machine.js', # https://github.com/jakesgordon/javascript-state-machine
'js/game/base.js',
'js/game/game.js',
'js/game/dom.js',
'js/game/menu.js',
'js/game/key.js',
'js/game/math.js',
'js/game/vector.js',
'js/snakes.js'
],
"styles.css" => [
'css/vendor/normalize.css',
'css/snakes.css'
]
}
end
Will make 3 rake tasks available to you:
> rake -T
rake assets:clear # clear unified asset files
rake assets:create # create unified asset files
rake assets:server # simple webserver that auto-regenerates assets if they are out of date
Use rake assets:create
whenever your source files have changed to recreate the unified/minified versions.
Use rake assets:server
to run a simple rack-based web server that can serve up your static website
and will automatically regenerate your unified assets if the source files have been changed.
MIT license.
If you have any ideas, feedback, requests or bug reports, you can reach me at jake@codeincomplete.com, or via my website: Code inComplete.
FAQs
Unknown package
We found that unified-assets demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.