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

Extend pluginOptions to also cover gulp-sourcemaps #65

Closed narthollis closed 9 years ago

narthollis commented 9 years ago

As per issue #64

Currently this both the options for sourcemap.init and sourcemap.write compressed into the same option.

I can't see any option conflicts upstream, so I don't think this would be an issue.

chmontgomery commented 9 years ago

Thanks for the PR! Definitely on the right track. A couple things:

main: {
  scripts: [
    './*.js'
  ],
  styles: [
    './*.css'
  ],
  options: {
    pluginOptions: {
      'gulp-sourcemaps': {
        init: {loadMaps: false, debug: true},
        write: {addComment: false},
        destPath: '../maps' // this is the string "maps" by default
      }
    }
  }
}
main: {
  scripts: [
    './*.js'
  ],
  styles: [
    './*.css'
  ],
  options: {
    pluginOptions: {
      'gulp-sourcemaps': {
        init: {debug: true},
        write: {addComment: false},
        destPath: '../maps',
        scripts: {
            init: {loadMaps: false},
            write: {addComment: true} // overrides {addComment: false}
        },
        styles: {
            init: {loadMaps: true},
            destPath: 'maps' // overrides '../maps'
        }
      }
    }
  }
}

Let me know if you'll be able to look into these items or have different ideas

narthollis commented 9 years ago

Yeah, this seams all quite reasonable.

I will get this sorted tonight and update the PR.

narthollis commented 9 years ago

I have updated this pull request with the suggested chnages.

chmontgomery commented 9 years ago

this change has landed in v2.23.0. Thanks for contributing!

chmontgomery commented 9 years ago

please try it out and let me know if there are any issues