After seeing the following graph [here](http://sweetme.at/2013/09/11/how-to-maximize-png-image-compression-with-optipng/) we decided to test optimsation level 2 for OptiPNG instead of 7. This is because, acording to the graph we would notice no real difference in avarage file size but would notice a speed increase with our builds.

After testing , we noticed our theme build go from a build time of over 10 mins (just on the 94% asset optimisation step) to an avarage of `150.75s`. All the while, we only gained 10-15kb per png file which we believe more than reasonable for a build speed increase of this magnatude.
Using `merge.smartStrategy` with `'module.loaders' = 'replace'` to load
the preset config allows presets to override the the default webpack
config. This is necessary for the coming Tailwind preset which requires
`resolve-url-loader` and source maps to be disabled.
It is especially neat when importing the scripts from the parent theme in a child theme. In one of my themes I do it like this:
```js
// routes.js
import home from './routes/home'
export default {
home: {
init() {
console.log('Home route fired.')
}
}
}
```
```js
// main.js
/**
* Parent Themes Script
*/
import '../../../../core-theme/resources/assets/scripts/main';
/**
* Internal modules
*/
import routes from './routes'
/**
* Hook in to the parent themes router
*/
document.addEventListener('routed', e => {
let route = e.detail.route,
fn = e.detail.fn;
if (routes[route] && typeof routes[route][fn] === 'function') {
routes[route][fn]();
}
});
```
* Add uglifyjs plugin and replace -p flag with --env.production
* Add uglifyjs plugin
* Configure UglifyJsPlugin to drop console and prevent eslint error
* Turn off no-console rule because uglifyjs plugin drops it in prod