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

need a way to specify output file #188

Open
clarkevans opened this issue Sep 22, 2018 · 1 comment

Comments

@clarkevans
Copy link

commented Sep 22, 2018

Currently, the inliner script writes to stdout. I'm not sure what the exact issue is, but it wouldn't work on GitLab's CI service, the file would be created but would be zero length when using > redirection. Anyway, it was easy enough to write a simple script that works, hard coding paths. It'd also be helpful to have default size that is a bit bigger, large SVG files don't get inlined by default. Thank you so much.

#!/usr/bin/env node                                                     
var inliner = require("inliner");
var fs = require("fs");

new inliner("build/index.html", {size : 1024* 1024 }, 
  function(err, text) {
    if(err) {
       console.log(err);
       process.exit(1);
    }
    fs.writeFile("demo.html", text, 
      function(err) {
        if(err) {
           console.log(err);
           process.exit(1);
        }
    });
  });
@clarkevans

This comment has been minimized.

Copy link
Author

commented Sep 24, 2018

Hmm. This may not be the core issue. Perhaps it's that inliner.js expects
that it is outputting to a terminal? see inliner/cli/progress.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.