[RC0] How to build in dev mode to speed up compilation?


#1

Hi,

With the latest release of Ionic 2 RC0, compilation takes more time. As you may know, with RC0 npm scripts are now used for the build process and with by default it’s compiling in production mode.

I know we can run with success : “npm run build --dev” but it doesn’t work with “ionic build

How can we build in dev mode in order to reduce build time ?


#2

According to : https://github.com/driftyco/ionic-app-scripts#ionic-environment-variable

“process.env.IONIC_ENV environment variable can be used[…]”

How can we set this environment variable ?


#3

Add a --dev in your package.json file, under scripts.build.

“scripts”: {
“build”: “ionic-app-scripts build –dev”,

}

A other usefull trick :
set “run:before” to “watch” to enable livereload on your device…


#4

Thanks !

But livereload doesn’t work…

I’m using :

ionic emulate ios -l -c

with “run:before” set to “watch” in the package.json file.

Any idea ?


#5

Silly,

emulate:before set to “watch”

instead of “run:before” for the emulation