0

I am creating my own Shopify Theme in the liquid templates. I installed laravel-elixir and gulp to help combine my css and js as well as minify my html. When running gulp I get an error that says:

events.js:160
      throw er; // Unhandled 'error' event
      ^
Error: Parse Error: <' | append: 'img' %}
{% if article.excerpt_or_content contains img_tag %}

I placed the <!-- htmlmin:ignore --> tag around the error spot and I am getting the same error. In my gulp file I created a customAttrSurround and I am still getting the same issue. I am trying to get the htmlmin to ignore all of the liquid brackets. Any Help Appreciated.

const elixir = require('laravel-elixir');
require('laravel-elixir-minify-html');
var liquidignore = [
    '/\{\{.*\}\}',
    '/\{\%.*\%\}',
];

elixir((mix) => {
    mix.styles([
              '../../../theme/bootstrap/css/bootstrap.css',
              '../../../theme/plugins/magnific-popup/magnific-popup.css',
              '../../../theme/css/animations.css',
              '../../../theme/plugins/owl-carousel/owl.carousel.css',
              '../../../theme/plugins/owl-carousel/owl.transitions.css',
              '../../../theme/plugins/hover/hover-min.css',
              '../../../theme/css/style.css',
              '../../../theme/css/skins/light_blue.css'
    ], 'assets/app.css')
    .scripts([
              '../../../theme/plugins/jquery.min.js',
              '../../../theme/bootstrap/js/bootstrap.min.js',
              '../../../theme/plugins/modernizr.js',
              '../../../theme/plugins/magnific-popup/jquery.magnific-popup.min.js',
              '../../../theme/plugins/waypoints/jquery.waypoints.min.js',
              '../../../theme/plugins/jquery.countTo.js',
              '../../../theme/plugins/jquery.parallax-1.1.3.js',
              '../../../theme/plugins/owl-carousel/owl.carousel.js',
              '../../../theme/plugins/jquery.browser.js',
              '../../../theme/plugins/SmoothScroll.js',
              '../../../theme/js/template.js'
    ], 'assets/app.js')
    .copy('assets', 'upload/assets')
    .copy('config', 'upload/config')
    .copy('layout', 'upload/layout')
    .copy('snippets', 'upload/snippets')
    .copy('templates', 'upload/templates')
    .html('upload/snippets/*', 'upload/snippets', {collapseWhitespace: true, removeAttributeQuotes: true, removeComments: true, minifyJS: true, customAttrSurround: liquidignore})
    .html('upload/templates/*', 'upload/templates', {collapseWhitespace: true, removeAttributeQuotes: true, removeComments: true, minifyJS: true, customAttrSurround: liquidignore})
    .html('upload/layout/*', 'upload/layout', {collapseWhitespace: true, removeAttributeQuotes: true, removeComments: true, minifyJS: true, customAttrSurround: liquidignore})
});
Varcor
  • 69
  • 1
  • 5

0 Answers0