ianllewellyn / modernizr-brunch

Adds automatic modernizr builds to brunch
3 stars 1 forks source link

Doesn't search compiled files if not using joinTo #3

Open danbrellis opened 1 year ago

danbrellis commented 1 year ago

Currently, in the plugin searches through all the files from the brunch-config joinTo property (index.js line 16) and creates the necessary js file depending on tests it finds are needed.

However, if your brunch-config uses the entryPoints property to determine the compiled files, the plugin won't search your compiled files and thus won't create a destination js.

Reproduce with brunch-config.js:

module.exports = {
  paths: {
    public: './html/assets'
  },
  files: {
    javascripts: {
      entryPoints: {
          'app/initialize.js': 'js/app.js'
      }
    }
  },
  plugins: {
    modernizr: {
      destination: 'javascripts/modernizr.js'
      options: [ 'setClasses' ]
      tests: ['cors', 'xhr2']
    }
  }
}

I think you could fix this by simply merging any files from the entryPoints property(ies) and merging that into your joinTo array before looping. Happy to offer a PR if you'd like.

danbrellis commented 1 year ago

Meant to link to brunch docs that talk about entryPoints: https://brunch.io/docs/config#files