ngrx/store

aot with universal

dknitrox opened this issue · 1 comments

I'm trying to compile into a universal application, but I throw the following error

 import { OpaqueToken, NgModule } from '@angular/core';
                                                              ^^^^^^
SyntaxError: Unexpected token import

I know there is a thread of it even post a possible solution, but it has not worked for me

#387

The repository I use is the following

https://github.com/FrozenPandaz/ng-universal-demo

as I have configured the externals module in my webpack.config.js

externals: [
includeClientPackages(/@AngularClass|@angular|angular2-|ng2-|ng-|@ng-|angular-|ngrx|@ngrx|@angular2|ionic|@Ionic|-angular2|-ng2|-ng/),
nodeExternals()
]

This is not related to ngrx specifically, it's a bundling/tooling question (short answer: you need to use commonjs, or bundle, when running in node)