{"id":21968299,"url":"https://github.com/eternalsayed/ci-output-minifier","last_synced_at":"2026-04-18T02:03:24.457Z","repository":{"id":43129548,"uuid":"51366691","full_name":"eternalsayed/ci-output-minifier","owner":"eternalsayed","description":"Minifies the output CSS, JS and HTML. Merges all the CSS and all the JS into single cached file.","archived":false,"fork":false,"pushed_at":"2016-09-05T19:28:59.000Z","size":708,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T22:16:34.857Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eternalsayed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-09T12:55:49.000Z","updated_at":"2016-02-09T13:40:21.000Z","dependencies_parsed_at":"2022-09-22T06:22:20.085Z","dependency_job_id":null,"html_url":"https://github.com/eternalsayed/ci-output-minifier","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eternalsayed/ci-output-minifier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eternalsayed%2Fci-output-minifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eternalsayed%2Fci-output-minifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eternalsayed%2Fci-output-minifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eternalsayed%2Fci-output-minifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eternalsayed","download_url":"https://codeload.github.com/eternalsayed/ci-output-minifier/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eternalsayed%2Fci-output-minifier/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31953516,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-29T13:52:17.214Z","updated_at":"2026-04-18T02:03:24.442Z","avatar_url":"https://github.com/eternalsayed.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ci-output-minifier\nCodeIgniter css, js and html minifier. This code was created in CodeIgniter 3.0.1 but I assume, it would work for 2.x as well. Please test it yourself before integrating it in your project\n# What is ci-output-minifier\nIt's simply a hook that preprocesses your request before outputing it to browser and combines and minifies all the CSS and JS into one single minified JS and CSS files respectively. This file is stores in cached/js/ and cached/css/ under root. PLEASE NOTE: No modification is done to the CSS/JS code as this minification is carried out by regular expression matching, which means, the path to any imports/URLs are not changed as well. To support that, it also copies any such referenced fonts/images under cached/fonts and cached/images/ directories.\nPlease ensure that your 'cached' directory has enough permissions for the hook to work.\n\n#How does it work?\nDownload and unzip the package. Copy 'resource.php' from application/hooks and copy it under the same path (ie, application/hooks) in your project.\nIn your config/hooks.php, add the following towards the bottom of the file:\u003cbr\u003e\n\u003ccode\u003e\u003cpre\u003e\n$hook['pre_controller'][] = array(\n    'class'     =\u003e 'Resource',\n    'function'  =\u003e 'init',\n    'filename'  =\u003e 'resource.php',\n    'filepath'  =\u003e 'hooks'\n);\n$hook['display_override'][] = array(\n    'class'     =\u003e 'Resource',\n    'function'  =\u003e 'renderHTML',\n    'filename'  =\u003e 'resource.php',\n    'filepath'  =\u003e 'hooks'\n);\u003c/pre\u003e\n\u003c/code\u003e\nNow, if you want any css/js to be minified, include it within your template in following manner:\u003cbr\u003e\n\u003ccode\u003e\u003cpre\u003e\n\\\u003clink rel=\"text/stylesheet\" href=\"\u003c?php echo Resource::css('assets/css/index.css')?\u003e\" /\u003e\n\\\u003clink rel=\"text/stylesheet\" href=\"\u003c?php echo Resource::css('assets/css/guest.css')?\u003e\" /\u003e\n\\\u003cscript rel=\"text/javascript\" href=\"\u003c?php echo Resource::js('assets/js/jquery1.10.2.min.js')?\u003e\"\u003e\\\u003c/script\u003e\n\\\u003cscript rel=\"text/javascript\" href=\"\u003c?php echo Resource::js('assets/js/index.js')?\u003e\"\u003e\\\u003c/script\u003e\u003c/pre\u003e\n\u003c/code\u003e\nThis would create two files, one under js and other under css in name of index.guest.min.css and jquery1.10.2.index.min.js. These files will be created on only first time load of the page. On further requests, it would simply load that file.\nAlso note that if any of the included css/js files are modified, the minified js/css will be auto updated.\n#Note\nYou could rather merge all the files inspite of having to specify them via call to 'Resource::css' or 'Resource::js'. Just edit the resource.php and remove the check for 'in_array' at lines 72 and 119 respectively.\nHope that helps!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feternalsayed%2Fci-output-minifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feternalsayed%2Fci-output-minifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feternalsayed%2Fci-output-minifier/lists"}