Minimal preprocessing with /*@include*/
Previously used /*>
. Converted to handle the more verbose @include
to be compatible with the preprocess npm library.
jspp input > output
main.js
/*@include script.js */ |
css/style.css
html, body {margin:0; padding:0} /*@include http://js-preprocessor.com/example/css/child.css */ .my-style {background: #fffacc} |
css/child.css .i-am-child {} |
script.js var my_script; |
$ jspp example/main.js
var my_script;
var style = "html, body {margin:0; padding:0}\
.i-am-child {}\
.my-style {background: #fffacc}"
JavaScript preprocessor in a wild: GitHub Live Preview, Faviconize Google, Nice Alert.
$ gem install jspp
The included spec files can be run with ruby spec/jspp_spec.rb
. As of 2014-10-21 the tests all fail due to language errors but the system appears to work when run on the example file.
Sprockets can't include non-JS files. JS preprocessor can.
Juicer don't have any analogies to "/*> some_file */"
.
I.e., it can't include files as multiline string.