tolyo/html-pages-brunch

Doesn't minify html-files outside of 'assets'

jepz opened this issue · 14 comments

jepz commented

Had installed brunch by
$ brunch new proj -s es6,
istalled your plugin
npm install --save-dev html-pages-brunch
Added my HTML files outside of the folder app/assets, so they are now stored in app.

running brunch build --production does not add files in the folder public.

Is there any configuration I'm missing?

tolyo commented

You may be overriding conventions.assets setting to ignore .html files. Can you show your config please.

jepz commented

I tried to add everything that could be added just to make it work somehow.
File brunch-config.js:

module.exports = {
  files: {
    javascripts: {
      joinTo: {
        'vendor.js': /^(?!app)/,
        'app.js': /^app/
      }
    },
    stylesheets: {joinTo: 'css/app.css'}
  },

  plugins: {
      babel: {presets: ['es2015']},
      htmlPages: {
            htmlMin: {
              caseSensitive: false,
              collapseBooleanAttributes: true,
              collapseInlineTagWhitespace: false,
              collapseWhitespace: true,
              conservativeCollapse: false,
              html5: true,
              includeAutoGeneratedTags: false,
              keepClosingSlash: false,
              minifyCSS: true,
              minifyJS: true,
              preserveLineBreaks: false,
              preventAttributesEscaping: false,
              processConditionalComments: true,
              removeAttributeQuotes: true,
              removeComments: true,
              removeEmptyAttributes: true,
              removeOptionalTags: true,
              removeScriptTypeAttributes: true,
              removeStyleLinkTypeAttributes: true,
              sortAttributes: true,
              sortClassName: true    
            },
            destination(path) {
              return path.replace(/^app[\/\\](.*)\.html$/, "$1.html");
            },
            disabled: false
          }

  }
};

tolyo commented

I see it now. Please downgrade to 2.0.6 while I fix this

jepz commented

I downgraded to 2.0.6 but html-files in "app" does not get modified and moved to "Public".

Amnythings else I can show you?

tolyo commented

I meant 2.0.5 :) I am fixing this. Hang on

tolyo commented

Published 2.2.0. Try it.

jepz commented

Alright! it now adds files into public, but the comments aren't removed...

jepz commented

..and "collapseWhitespace" doesn't work either...

tolyo commented

Set optimize to true

jepz commented

Nice! works lovely, do i need to keep all the other options or is "optimize" enough?

tolyo commented

Well optimize gets turned to true by default for build prod. So you can safely ignore it while watch -s.

tolyo commented

I should document that....

jepz commented

;-) yes you should.

Thanks for the help!

tolyo commented

Np