-
Notifications
You must be signed in to change notification settings - Fork 84
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
How to use the cli? #221
Comments
Not sure why that happens for you, just tried and all succeeded: mkdir /tmp/test && cd /tmp/test
echo '{ "dependencies": ["mincer"] }' > package.json
npm install
mkdir -p {app,vendor}/assets/javascripts
echo 'alert("BOOM");' > vendor/assets/javascripts/abc.js
echo '//= require abc' > app/assets/javascripts/main.js
node node_modules/.bin/mincer \
--include app/assets/javascripts \
--include vendor/assets/javascripts \
--output public \
main.js
find public -type f | while read filename; do
echo "=== ${filename} ==="
cat $filename
echo
done Outputs:
|
I'm on mincer 1.3.0. I'll check if upgrading fixes this, and if not continue investigating what may be happening on my end. |
I upgraded to the latest version and still no luck. Your example runs perfectly fine though, so I'll continue to investigate any possible differences and report back. |
Obviously it was developer blindness/stupidity. The asset I was trying to compile was in a sub-directory of
However it seems like the CLI utility has no way of compressing assets, or am I missing something? |
Well, cli is pretty simple yeah. And honestly was implemented only as an attempt to match sprocket's CLI. But I don't see any realy practical usage of it. IMHO it's better to write your own runner that will be configure Mincer environment the way you need. And will be:
|
Well, I just needed a one time compression of assets, so I thought I'd use the CLI. Would you take a PR to add compression support to the CLI? Something like:
|
#!/usr/bin/env node
var Mincer = require("mincer"),
environment = new Mincer.Environment(__dirname);
environment.appendPath("app/assets/javascripts");
environment.appendPath("vendor/assets/javascripts");
environment.enable("autoprefixer");
environment.jsCompressor = "uglify";
environment.cssCompressor = "csswring";
var manifest = new Mincer.Manifset(environment, "public");
manifest.compile(["main.js"]); |
Yeah. I'm OK with PR that will allw configure js/css compressor on CLI, as well as |
What is |
to enable different plugins, like autoprefixer for example |
Ah! Good point :) |
app/assets/javascripts
andvendor/assets/javascripts
app/assets/javascripts/main.js
app
) I tried the commands:node_modules/.bin/mincer --include app/assets/javascripts --include vendor/assets/javascripts --output public main.js # and node_modules/.bin/mincer --include app/assets/javascripts --include vendor/assets/javascripts main.js
In the first case nothing happens. There is no error but no assets are compiled. In the second example I get
Cannot find logical path: main.js
. I tried all variations of paths possible to get tomain.js
, namelyassets/main.js
,app/assets/main.js
,app/assets/javascripts/main.js
.So, how is this program supposed to be used?
The text was updated successfully, but these errors were encountered: