// Note: You must restart bin/webpack-watcher for changes to take effect

const webpack = require('webpack')
const merge   = require('webpack-merge')

const sharedConfig = require('./shared.js')

module.exports = merge(sharedConfig.config, {
  output: { filename: '[name]-[hash].js' },

  plugins: [
    new webpack.LoaderOptionsPlugin({
      minimize: true
    })
  ]
})

// Note: You must restart bin/webpack-watcher for changes to take effect

const webpack = require('webpack')
const merge   = require('webpack-merge')

const sharedConfig = require('./shared.js')

module.exports = merge(sharedConfig.config, {
  output: { filename: '[name]-[chunkhash].js' },

  plugins: [
    new webpack.LoaderOptionsPlugin({
      minimize: true
    })
  ]
})

Use [chunkhash] instead of [hash] by default
Use [chunkhash] instead of [hash] by default

[hash] gives all packs the same hash, e.g.

```
Compiled digests for all packs in /Users/schpet/code/rails-webpack-testing/minification-test/public/packs/digests.json:
{"application":"application-2a726f371dbd0b903b72.js","foo":"foo-2a726f371dbd0b903b72.js"}
```

this means that if you change foo.js (or any of it's dependencies), it
will invalidate the cache for all other packs.

chunkhash gives each pack their own hash, e.g.

```
Compiled digests for all packs in
/Users/schpet/code/rails-webpack-testing/minification-test/public/packs/digests.json:
{"application":"application-7badfb4208be6956638b.js","foo":"foo-6607498e56881eb3c594.js"}
```

and on subsequent changes to foo.js, application.js keeps the same hash:

```
Compiled digests for all packs in /Users/schpet/code/rails-webpack-testing/minification-test/public/packs/digests.json:
{"application":"application-7badfb4208be6956638b.js","foo":"foo-67c0c22479fe4b41b27b.js"}
```
