html5 - silex php framework mix with grunt -
i have configurations in grunt /** * generated on 2013-07-31 using generator-angular 0.3.0 * generate separate angular template install grunt grunt cli * @author: frank marcelo */ 'use strict'; module.exports = function (grunt) { require('matchdep').filterdev('grunt-*').foreach(grunt.loadnpmtasks); // configurable paths var yeomanconfig = { app: '../app/views/development', appimages: '../app/img', dist: '../app/views/production', less: 'css/less', binless: '../bin/less', css: 'css', js: 'js', images: 'img', timestamp: (new date()).gettime().tostring(), randomport: math.floor((math.random() * 10000) + 1) }; try { yeomanconfig.app = require('./bower.json').apppath || yeomanconfig.app; } catch (e) {} grunt.initconfig({ yeoman: yeomanconfig, jshint: { options: { jshintrc: '.jshintrc', reporter: require('jshint-stylish')}, all: [ 'gruntfile', 'js/{,*/}*.js' ] }, imagemin: { dist: { options: { optimizationlevel: 7 }, files: [{ expand: false, cwd: '<%= yeoman.images %>/', src: '**/*.{png,jpg,jpeg,gif}', dest: '<%= yeoman.images %>/dist/' }] } }, cssmin: { dist: { options: { keepspecialcomments: 0}, files: { '<%= yeoman.css %>/ie8.css': ['<%= yeoman.less %>/ie8.less'], '<%= yeoman.css %>/cyberu.css': ['<%= yeoman.less %>/cyberu.less'], '<%= yeoman.css %>/print.css': ['<%= yeoman.less %>/print.less'], '<%= yeoman.css %>/main.css': ['<%= yeoman.css %>/main.css'] } } }, htmlcompressor: { dist: { files: { '<%= yeoman.dist %>/index.html.twig': '<%= yeoman.dist %>/index.html.twig', '<%= yeoman.dist %>/print.lesson.html.twig': '<%= yeoman.dist %>/print.lesson.html.twig', '<%= yeoman.dist %>/404.html.twig': '<%= yeoman.dist %>/404.html.twig', '<%= yeoman.dist %>/elements/base_headers.html.twig': '<%= yeoman.dist %>/elements/base_headers.html.twig', '<%= yeoman.dist %>/elements/analytics.html.twig': '<%= yeoman.dist %>/elements/analytics.html.twig' }, options: { type: 'html', preserveserverscript: true, compressjs: true, compresscss: true } } }, clean: { dist: { options: { force: true }, src: ['<%= yeoman.dist %>/*', '<%= yeoman.images %>/*'] } }, concurrent: { dist: [ 'usemin' ], options: { logconcurrentoutput: true } }, copy: { dist: { files: [{ expand: true, cwd: '<%= yeoman.app %>/', src: ['**'], dest: '<%= yeoman.dist %>/' }, { expand: true, cwd: '<%= yeoman.appimages %>/', src: ['**'], dest: '<%= yeoman.images %>/' }] } }, less: { development: { options: { paths: ['<%= yeoman.binless %>'] }, files: { '<%= yeoman.css %>/main.css': "<%= yeoman.binless %>/main.less" } } }, ngmin: { dist: { files: [{ expand: true, cwd: '<%= yeoman.js %>', src: ['modules.js'], dest: '<%= yeoman.js %>' }] } }, uglify: { dist: { options: { beautify: true }, files: { '<%= yeoman.js %>/vendor/components.js': ['<%= yeoman.js %>/vendor/components.js'] } } }, useminprepare: { html: ['<%= yeoman.app %>/index.html.twig', '<%= yeoman.app %>/elements/base_headers.html.twig', '<%= yeoman.app %>/print.lesson.html.twig'], options: { dest: '<%= yeoman.dist %>' } }, usemin: { html: ['<%= yeoman.dist %>/{,*/}*.twig'], css: ['<%= yeoman.css %>/{,*/}*.css'], options: { assetsdirs: ['<%= yeoman.images %>'], patterns: { js: [ [/(img\/.*?\.(?:gif|jpeg|jpg|png|webp))/gm, 'update js reference our revved images'] ] } } }, replace: { distbuildtime: { options: { variables: { 'build-time': '<%= yeoman.timestamp %>' }, prefix: '@@' }, expand: true, cwd: '<%= yeoman.dist %>', src: ['**/{,*/}*.twig'], dest: '<%= yeoman.dist %>' } }, rev: { dist: { files: { src: [ '<%= yeoman.images %>/{,*/}*.{png,jpg,jpeg,gif}' ] } } }, watch: { all: { files: ['gruntfile.js', 'js/app/**/*', 'css/**/*', 'vendor/**/*', 'img/**/*', 'src/**/*'], tasks: ['default'], options: { livereload: true, nospawn: true, interrupt: true, debouncedelay: 250, dateformat: function (time) { grunt.log.writeln('the watch finished in ' + time + 'ms at' + (new date()).tostring()); grunt.log.writeln('waiting more changes...'); } } } }, reload: { port: '<%= yeoman.randomport %>', livereload: {}, proxy: { host: 'localhost', port: 8282 } } }); grunt.registertask('imageoptim', ['imagemin']);//optimise image grunt.registertask('revision', ['rev', 'usemin']);//versioning grunt.registertask('jslint', ['jshint']);//js hint , code coverage grunt.registertask('css', ['cssmin', 'revision']);//css minify grunt.registertask('default', [ 'clean:dist', 'copy', 'less', //'imagemin', 'cssmin', 'replace', 'useminprepare', 'concat', 'uglify', 'rev', 'usemin', 'htmlcompressor', 'reload' ]); };
any way use grunt revisions inside twig template? because cannot produce proper deployed version of artefacts. has encountered issues grunt silex symfony microframework?
ive been digging issue few days maybe can help
Comments
Post a Comment