Skip to content
This repository has been archived by the owner on Jan 10, 2018. It is now read-only.

aot with universal #424

Closed
dknitrox opened this issue Jun 1, 2017 · 1 comment
Closed

aot with universal #424

dknitrox opened this issue Jun 1, 2017 · 1 comment

Comments

@dknitrox
Copy link

dknitrox commented Jun 1, 2017

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()
]

@robwormald
Copy link
Contributor

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)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants