Building AOT with ionic module template

I am trying to build a library with AOT for some datepicker library I have.
I got fraustrated and cloned this https://github.com/driftyco/ionic-module-template
I removed everything and left just the module itself and an index.ts

import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from "@angular/core";
import { BrowserModule } from "@angular/platform-browser";

    @NgModule({
      imports: [
        BrowserModule
      ],
      schemas: [
        CUSTOM_ELEMENTS_SCHEMA
      ]
    })
    export class DatePickerModule { }

This is my whole app. I just run ngc and get a dist build.
I import it and it works fine on serve but on --prod I am getting

Error: Unexpected value 'DatePickerModule' imported by the module 'AppModule'

What is the solution? Is this