I want to achieve this using grunt
Goal
- My main goal is to minify my index.php before placing them on my production server.
- It's simple if I have 1 single
index.html
, but I don't. - Instead I have an
index.php
full with other.php
files. - Each
<?php ?>
section is a block of HTML code.
index.php
<!DOCTYPE html>
<?php include '2015/layouts/ie.php'; ?>
<head>
<?php include '2015/layouts/meta.php'; ?>
<title>Title</title>
<?php include '2015/layouts/link.php'; ?>
<?php include '2015/layouts/style.php'; ?>
<?php include '2015/layouts/ie9.php'; ?>
</head>
<body >
<span id="web">
<?php include '2015/layouts/nav-bar.php'; ?>
<?php include '2015/layouts/welcome-sign.php'; ?>
<?php include '2015/layouts/profile.php'; ?>
<?php include '2015/layouts/skill.php'; ?>
<?php include '2015/layouts/education.php'; ?>
<?php include '2015/layouts/experience.php'; ?>
<?php include '2015/layouts/portfolio.php'; ?>
<?php include '2015/layouts/contact.php'; ?>
<?php include '2015/layouts/script.php'; ?>
</span>
<span id="print" style="display: none;" ><img src="2015/img/image.png" width="90%"></span>
</body>
</html>
Lastly
I'm wondering what is the most efficient way to concatenate all my .php files into one php file, and minify it.
I prefer to achieve this using grunt, but if someone might have other suggestion on a better solution please feel free to suggest me.