Example of output
file src/Rt/Bundle/AppBundle/Resources/frontend/views/_/index.twig
<header class="header"></header><main class="content" id="main"> <section class="search-product"> {% include 'block/index/search-product.twig' %} </section> <section class="offers"> {% include 'block/index/offers.twig' %} </section> <section class="prices"> {% include 'block/index/price.twig' %} </section> <section class="stores"> </section> <section class="selection"> {% include 'block/index/selection.twig' %} </section> <section class="size-section"> {% include 'block/index/size-section.twig' %} </section></main><footer id="footer"></footer>
compilation result: web/dependencies/js/views/_/index.twig.js
;
Parts of gulp file
var config = ENV: env dependencies: //.... views: path: './src/Rt/Bundle/AppBundle/Resources/frontend/views'//where placed twig files extensions: 'twig' //extension options: module: 'amd'//for future improvements twig: 'twig' compileOptions: viewPrefix: 'views/'//directory, where will be placed compiled templates //.... DEST_PATH: './web/dependencies';
'use strict'; var gulp = _ = bower = bowerNormalizer = rename = install = watch = babel = uglify = gutil = gulpif = rjs = twig_compile = shell = sourcemaps = sass = autoprefixer = cmq = progeny = minifyCss = browserSync = ; //......... var { return { return prefix + ': ' + filepath; }; }; //......... { var conf = configdependenciesviews paths = confpath + '/**/*.twig' ; confoptionscompileOptionslookPaths = confpath ; var ENV_VAR = '_GULP_DEP_VIEW_BUILD'; gulp; gulp;} { return gulp ;};