RS.0 Ionic serve is working but build is not

Hi, I am trying to figure out the new rollup bundling but having some problems with it.
My project is a mid-sized project. And several things seem to not work with rollup.
It started that I had to create a rollup.config to get PouchDB to work.
By now, my project is successfully built with “ionic serve” but if I want to emulate or build it, errors appear and the main.js is missing.

Your system information:

Cordova CLI: 6.3.1
Gulp version: CLI version 3.9.1
Gulp local:
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
ios-deploy version: 1.9.0
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v6.6.0
Xcode version: Xcode 8.0 Build version 8A218a

~/c/s/w/i/eGecko2Mobile ❯❯❯ ionic serve
Running ‘serve:before’ npm script before serve

eGECKO2mobile@ watch /Users/caj/css/src/web/ionic2/eGecko2Mobile
ionic-app-scripts watch
[17:47:39] ionic-app-scripts 0.0.23
[17:47:39] watch started …
[17:47:39] build dev started …
[17:47:39] clean started …
[17:47:39] clean finished in 12 ms
[17:47:39] copy started …
[17:47:39] typescript compiler started …
[17:47:39] lint started …
[17:47:39] copy finished in 126 ms
[17:47:40] lint finished in 1.39 s
[17:47:43] typescript compiler ready in 3.91 s
[17:47:43] bundle dev started …
[17:47:57] bundle dev finished in 14.09 s
[17:47:57] sass started …
[17:47:58] sass finished in 1.45 s
[17:47:58] build dev finished in 19.48 s
[17:47:58] watch ready in 19.60 s
Running live reload server: http://192.168.106.194:35729
Watching: www//*, !www/lib//, !www/**/.map
√ Running dev server: http://192.168.106.194:8100
Ionic server commands, enter:
restart or r to restart the client app from the root
goto or g and a url to have the app navigate to the given url
consolelogs or c to enable/disable console log output
serverlogs or s to enable/disable server log output
quit or q to shutdown the server and exit

ionic $ q
~/c/s/w/i/eGecko2Mobile ❯❯❯ ionic build ios

Running ‘build:before’ npm script before build

eGECKO2mobile@ build /Users/caj/css/src/web/ionic2/eGecko2Mobile
ionic-app-scripts build
[17:49:40] ionic-app-scripts 0.0.23
[17:49:40] build prod started …
[17:49:40] clean started …
[17:49:40] clean finished in 11 ms
[17:49:40] copy started …
[17:49:40] ngc started …
[17:49:40] lint started …
[17:49:40] copy finished in 76 ms
[17:49:42] lint finished in 1.25 s
[17:49:57] ngc finished in 16.89 s
[17:49:57] bundle prod started …
[17:49:57] Error: Could not resolve entry (./.tmp/app/main.dev.js)
at /Users/caj/css/src/web/ionic2/eGecko2Mobile/node_modules/rollup/dist/rollup.js:8602:28
at process._tickCallback (internal/process/next_tick.js:103:7)

[17:49:57] sass started …
[17:49:59] sass finished in 1.32 s
[17:49:59] minify started …
[17:49:59] cleancss started …
[17:49:59] uglifyjs started …
[17:49:59] Error: ENOENT: no such file or directory, open '/Users/caj/css/src/web/ionic2/eGecko2Mobile/www/build/main.js’
at Error (native)
at Object.fs.openSync (fs.js:640:18)
at Object.fs.readFileSync (fs.js:508:33)
at addFile (/Users/caj/css/src/web/ionic2/eGecko2Mobile/node_modules/uglify-js/tools/node.js:68:22)
at /Users/caj/css/src/web/ionic2/eGecko2Mobile/node_modules/uglify-js/tools/node.js:79:17
at Array.forEach (native)
at Object.exports.minify (/Users/caj/css/src/web/ionic2/eGecko2Mobile/node_modules/uglify-js/tools/node.js:77:26)
at runUglifyInternal (/Users/caj/css/src/web/ionic2/eGecko2Mobile/node_modules/@ionic/app-scripts/dist/uglifyjs.js:34:19)
at runUglify (/Users/caj/css/src/web/ionic2/eGecko2Mobile/node_modules/@ionic/app-scripts/dist/uglifyjs.js:23:28)
at Object.uglifyjs (/Users/caj/css/src/web/ionic2/eGecko2Mobile/node_modules/@ionic/app-scripts/dist/uglifyjs.js:9:12)

[17:49:59] cleancss finished in 897 ms
[17:49:59] minify finished in 899 ms
[17:49:59] build prod finished in 19.23 s
Running command: /Users/caj/css/src/web/ionic2/eGecko2Mobile/hooks/after_prepare/010_add_platform_class.js /Users/caj/css/src/web/ionic2/eGecko2Mobile

The rollup.config.js looks like this:
var ngTemplate = require(’…/node_modules/@ionic/app-scripts/dist/plugins/ng-template’).ngTemplate;
var nodeResolve = require(‘rollup-plugin-node-resolve’);
var builtins = require(‘rollup-plugin-node-builtins’);
var commonjs = require(‘rollup-plugin-commonjs’);
var globals = require(‘rollup-plugin-node-globals’);
var json = require(‘rollup-plugin-json’);

// https://github.com/rollup/rollup/wiki/JavaScript-API

var rollupConfig = {

/**
 * entry: The bundle's starting point. This file will
 * be included, along with the minimum necessary code
 * from its dependencies
 */
entry: './.tmp/app/main.dev.js',

/**
 * sourceMap: If true, a separate sourcemap file will
 * be created.
 */
sourceMap: true,

/**
 * format: The format of the generated bundle
 */
format: 'iife',

/**
 * dest: the output filename for the bundle in the buildDir
 */
dest: 'main.js',

/**
 * plugins: Array of plugin objects, or a single plugin object.
 * See https://github.com/rollup/rollup/wiki/Plugins for more info.
 */
plugins: [

	ngTemplate(),
	builtins(),
	json(),

	nodeResolve({
		main: true,
		module: true,
		jsnext: true,
		browser: true,
		extensions: ['.js', '.json']
	}),

	commonjs({
		namedExports: {
			'node_modules/js-extend/extend.js': ['extend']
		}
	}),

	globals()
]

};

if (process.env.IONIC_ENV == ‘prod’) {

// production mode
rollupConfig.entry = '.tmp/app/main.prod.js';

}

module.exports = rollupConfig;

Has anyone any idea why the file isn’t created when I am building the project.