# Minifying / Uglifying code pushed to APK files

**URL:** <https://forum.ionicframework.com/t/minifying-uglifying-code-pushed-to-apk-files/39470>\
**Category:** ionic-v3\
**Created:** [December 17, 2015, 11:12pm UTC](https://forum.ionicframework.com/t/minifying-uglifying-code-pushed-to-apk-files/39470 "2015-12-17T23:12:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![krz37](https://avatars.discourse-cdn.com/v4/letter/k/cab0a1/32.png) [@krz37](https://forum.ionicframework.com/u/krz37)\
**Post date:** [December 17, 2015, 11:12pm UTC](https://forum.ionicframework.com/t/minifying-uglifying-code-pushed-to-apk-files/39470/1 "2015-12-17T23:12:57Z")

</div>

Hello,  
Did anyone manage to minify / uglify the CSS / JS without breaking up dependencies for Ionic 2? Or is this already handled automatically when packaging a built APK / iOS deployement?

---

<div class="post-metadata">

**Author:** ![olavocneto](https://avatars.discourse-cdn.com/v4/letter/o/da6949/32.png) [@olavocneto](https://forum.ionicframework.com/u/olavocneto)\
**Post date:** [February 25, 2016, 3:13pm UTC](https://forum.ionicframework.com/t/minifying-uglifying-code-pushed-to-apk-files/39470/2 "2016-02-25T15:13:41Z")

</div>

Hi,

“ionic-framework”: “2.0.0-beta.1”

webpack.config.js

```auto
var path = require('path');
var UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin');

module.exports = {
  entry: [
...
  ],
  output: {
...
  },
  module: {
...
  },
  resolve: {
...
  },
  plugins: [
    new UglifyJsPlugin({
      // to debug prod builds uncomment //debug lines and comment //prod lines

      // beautify: true,//debug
      // mangle: false,//debug
      // dead_code: false,//debug
      // unused: false,//debug
      // deadCode: false,//debug
      compress : { screw_ie8 : true, keep_fnames: true, drop_debugger: false, dead_code: false, unused: false, }, // debug
      // comments: true,//debug

      beautify: false,//prod
      // disable mangling because of a bug in angular2 beta.1, beta.2 and beta.3
      // TODO(mastertinner): enable mangling as soon as angular2 beta.4 is out
      // mangle: { screw_ie8 : true },//prod
      mangle: false,
      // compress : { screw_ie8 : true},//prod
      comments: false//prod

    })
  ]
};

```

Uglifying still failing.

```auto
No provider for e! (e -> e)

```

Minifying works.

Source:  
[https://github.com/AngularClass/angular2-webpack-starter/blob/master/webpack.prod.config.js#L146](https://github.com/AngularClass/angular2-webpack-starter/blob/master/webpack.prod.config.js#L146)
