protected function _generateScript($file, $filename, $input)
    {
        $id = str_replace($this->_settings['ext'], '', basename($filename));
        $filepath = str_replace($this->_settings['ext'], '', $filename);

        foreach ($this->_settings['paths'] as $path) {
            $path = rtrim($path, '/') . '/';
            if (strpos($filepath, $path) === 0) {
                $filepath = str_replace($path, '', $filepath);
            }
        }

        $config = [
            'asString' => true,
        ];

        $text = <<<JS
var hogan = require('hogan.js'),
    util = require('util');

try {
    var template = hogan.compile(%s, %s);
    util.print('\\nwindow.JST["%s"] = window.JST["%s"] = ' + template + ';');
    process.exit(0);
} catch (e) {
    console.error(e);
    process.exit(1);
}
JS;
        $contents = sprintf(
            $text,
            json_encode($input),
            json_encode($config),
            $id,
            $filepath
        );
        file_put_contents($file, $contents);
    }