dowjones / gulp-bundle-assets

Create static asset (js, css) bundles from a config file: a common interface to combining, minifying, revisioning and more
MIT License
133 stars 36 forks source link

Allow skipping revision hash addition #57

Closed chadwilken closed 9 years ago

chadwilken commented 9 years ago

I current have another tool setup to allow me to version my assets and need to use that. It doesn't work well with the revision hash added to the asset name. Is there a way to use this without getting the hash?

chmontgomery commented 9 years ago

Yes! All you need to do is use the rev: false option, e.g.

bundle: {
  header: {
    scripts: [
      './js/header-scripts.js'
    ],
    styles: [
      './styles/header.css'
    ],
    options: {
      rev: false // {(boolean|string|Array)}
    }
  }
}

See here for the option in action. If that doesn't work, let me know.

chadwilken commented 9 years ago

That is what I have but it doesnt seem to be working unless it is caching my config file or something

module.exports = {
  bundle: {
    site: {
      scripts: [
      'assets/javascripts/vendor/moderniz-*',
      'assets/javascripts/vendor/jquery-2.1.1.js',
      'assets/javascripts/vendor/jquery.cookie.js'
      ],
      styles: [
        'theme/html/assets/stylesheets/pixel-admin.min.css',
        'theme/html/assets/stylesheets/widgets.min.css',
        'theme/html/assets/stylesheets/rtl.min.css',
        'theme/html/assets/stylesheets/pages.min.css',
        'theme/html/assets/stylesheets/themes.css'
      ],
      options: {
        rev: false
      }
    }
  }
};
chmontgomery commented 9 years ago

Your config file will only be cached when in watch mode. Otherwise, every new invocation of bundle() should re-require your bundle config.

As is, your code looks fine. Do you have a project you can share with more context? Perhaps your full bundle.config.js and gulpfile.js?

chadwilken commented 9 years ago

Man sorry for the confusion something went haywire with my system and it was fine once I closed out of Visual Studio...Sorry too waste your time, thanks for the quick replies!

chmontgomery commented 9 years ago

np