Given the following directory structure:
– Gruntfile.js – app |– index.php |– js |– css |– templates |– template.php – dist
How to configure grunt usemin to update the links to styles and scripts in the template file relative to index.php that uses the template?
Currently, the tasks are as follows:
useminPrepare: { html: '<%= yeoman.app %>/templates/template.php', options: { dest: '<%= yeoman.dist %>' } }, usemin: { html: ['<%= yeoman.dist %>/{,*/}*.php'], css: ['<%= yeoman.dist %>/css/*.css'], options: { dirs: ['<%= yeoman.dist %>'] } }
And the blocks inside the template look like this:
<script src="js/script1.js"></script> <script src="js/script2.js"></script>
gang
source share