tolyo / html-pages-brunch

Brunch plugin for compiling and minifying HTML files
MIT License
11 stars 4 forks source link

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

Closed jepz closed 8 years ago

jepz commented 8 years ago

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 8 years ago

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

jepz commented 8 years ago

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 8 years ago

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

jepz commented 8 years ago

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 8 years ago

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

tolyo commented 8 years ago

Published 2.2.0. Try it.

jepz commented 8 years ago

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

jepz commented 8 years ago

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

tolyo commented 8 years ago

Set optimize to true

jepz commented 8 years ago

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

tolyo commented 8 years ago

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

tolyo commented 8 years ago

I should document that....

jepz commented 8 years ago

;-) yes you should.

Thanks for the help!

tolyo commented 8 years ago

Np