# Custom build process with webpack 2

**URL:** <https://forum.ionicframework.com/t/custom-build-process-with-webpack-2/68206>\
**Category:** ionic-v3\
**Created:** [October 25, 2016, 9:22pm UTC](https://forum.ionicframework.com/t/custom-build-process-with-webpack-2/68206 "2016-10-25T21:22:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![luchillo17](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/luchillo17/32/78209_2.png) [@luchillo17](https://forum.ionicframework.com/u/luchillo17)\
**Post date:** [October 25, 2016, 9:22pm UTC](https://forum.ionicframework.com/t/custom-build-process-with-webpack-2/68206/1 "2016-10-25T21:22:51Z")

</div>

Soo the `@ionic/app-scripts` weren’t what i expected when they said were going to implement Webpack, so i’ve decided to implement my own build process, however there’s a few things idk how to do, `ionic (run|build) (android|ios)` are a mistery for me, idk how would i integrate that with webpack, anyone can tell me how’s the best way to deal with it?

**Update 1:**  
After looking a bit more i think i’ll just replace the npm scripts `build` and `watch` with webpack commands, that should replace the `ionic-app-scripts` build process.

---

<div class="post-metadata">

**Author:** ![mirkonasato](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mirkonasato/32/131398_2.png) [@mirkonasato](https://forum.ionicframework.com/u/mirkonasato)\
**Post date:** [October 25, 2016, 9:52pm UTC](https://forum.ionicframework.com/t/custom-build-process-with-webpack-2/68206/2 "2016-10-25T21:52:59Z")

</div>

Have a look at my [ionic2-webpack2-starter](https://github.com/mirkonasato/ionic2-webpack2-starter), although it’s still experimental. The [Cordova CLI](https://cordova.apache.org/docs/en/latest/guide/cli/) can do all the mobile-related stuff.

---

<div class="post-metadata">

**Author:** ![luchillo17](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/luchillo17/32/78209_2.png) [@luchillo17](https://forum.ionicframework.com/u/luchillo17)\
**Post date:** [October 25, 2016, 9:59pm UTC](https://forum.ionicframework.com/t/custom-build-process-with-webpack-2/68206/3 "2016-10-25T21:59:46Z")

</div>

Oh yeah i remember, you told me about `@ngtools/webpack`, yours seems like a simple config with a few complex stuff like the context replacement plugin, like the extract text plugin push when in prod, have you looked the [angular2-webpack-starter](https://github.com/AngularClass/angular2-webpack-starter)? i have a [fork](https://github.com/Luchillo/angular2-webpack-starter) with offline plugin working if you would like to take it as reference.

Btw what does that context replacement plugin in your webpack config?

---

<div class="post-metadata">

**Author:** ![mirkonasato](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mirkonasato/32/131398_2.png) [@mirkonasato](https://forum.ionicframework.com/u/mirkonasato)\
**Post date:** [October 25, 2016, 10:09pm UTC](https://forum.ionicframework.com/t/custom-build-process-with-webpack-2/68206/4 "2016-10-25T22:09:55Z")

</div>

I’m aware of the AngularClass starter (and a few others like the [preboot one](https://github.com/preboot/angular2-webpack)) but I wanted to create one from scratch to understand exactly how it works.

The `ContextReplacementPlugin` bit is because otherwise you get a weird warning; see [angular/angular#11580](https://github.com/angular/angular/issues/11580)

---

<div class="post-metadata">

**Author:** ![luchillo17](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/luchillo17/32/78209_2.png) [@luchillo17](https://forum.ionicframework.com/u/luchillo17)\
**Post date:** [October 25, 2016, 10:12pm UTC](https://forum.ionicframework.com/t/custom-build-process-with-webpack-2/68206/5 "2016-10-25T22:12:29Z")

</div>

I’ve been playing with the AngularClass one for quite a while so i understand most of it, i’ll stick to simple stuff as much as i can, yet i’ll use theirs as an example.
