Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide config as object instead of string #1

Closed
joh-klein opened this issue Mar 27, 2017 · 4 comments
Closed

provide config as object instead of string #1

joh-klein opened this issue Mar 27, 2017 · 4 comments

Comments

@joh-klein
Copy link

How do you feel about providing the UglifyJS, CleanCSS and HTML minifier config options directly as an object to usemin() instead of as a string to another file? I don't mean as a replacement but as another way.

@nelsyeung
Copy link
Owner

This actually sounds quite good. I guess we could have the configFile option alongside with a new config option which will override any settings set in the config file when both options are set. I will do this tonight (if I'm free), unless you want to implement it.

@nelsyeung
Copy link
Owner

I've added this, so now you can do something like:

usemin('src/index.html', 'dist', {
  output: 'dist/index.html',
  htmlmin: true,
  removeLivereload: true,
  config: {
    uglifyjs: {
    },
    cleancss: {
    },
    htmlminifier: {
      removeComments: false,
      collapseWhitespace: false,
      removeEmptyAttributes: false,
      removeScriptTypeAttributes: false,
      removeStyleLinkTypeAttributes: false,
      minifyJS: false,
      minifyCSS: false,
    }
  }
});

Do you mind testing this as well before I publish? Thanks!

@joh-klein
Copy link
Author

Looks fine to me. Does what I was hoping it would. Thanks!

@nelsyeung
Copy link
Owner

Thanks for testing! v0.5.0 has been published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants