unsafecode / ng2-aot Goto Github PK
View Code? Open in Web Editor NEWLittle Angular2 app shows how to AoT compilation with lazy routes
Little Angular2 app shows how to AoT compilation with lazy routes
Tried to give this a run. Something todo with missing genDir
? Issue for reference.
node -v
v6.1.0
Build command:
Hash: 99b9b2ec88050d744e51
Version: webpack 2.1.0-beta.22
Time: 1472ms
Asset Size Chunks Chunk Names
main.bundle.js 859 kB 0 [emitted] main
+ 175 hidden modules
ERROR in Cannot read property 'codeGen' of undefined
ERROR in ./app/main.jit.ts
Module not found: Error: Can't resolve './../$$_gendir/app/app.module.ngfactory' in '/Users/kyran/dev/demo/ng2-aot/app'
@ ./app/main.jit.ts 2:0-77
ERROR in ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js
Module not found: Error: Can't resolve '/Users/kyran/dev/demo/ng2-aot/$$_gendir' in '/Users/kyran/dev/demo/ng2-aot/node_modules/@angular/core/src/linker'
@ ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js 46:15-36 58:15-102
@ ./~/@angular/core/src/linker.js
@ ./~/@angular/core/src/core.js
@ ./~/@angular/core/index.js
@ ./~/@angular/platform-browser/src/browser.js
@ ./~/@angular/platform-browser/src/platform-browser.js
@ ./~/@angular/platform-browser/index.js
@ ./app/main.jit.ts
In my team we're trying to put together a working AOT build with angular 4, @ngtools/webpack (not full angular-cli) and lazy loaded modules. Mini repo is available here.
Current version excludes JiT-related entry points and uses AoT entry points. Build goes fine, but at runtime we see the dreaded Error: Cannot find module '../private/module.ngfactory'.
when trying to browse to lazy loaded area.
Locally we also tried doing the opposite (as you do in this repo): exclude AoT-related stuff and use JiT entry points. Same as before: build ok, error at runtime. We also tried adding "baseUrl": "."
to tsconfig, but it made no difference.
In both cases, as noted on other angular-cli issues (e.g. 2452), in build output folder we see 0-bundle.js.map
, but not 0-bundle.js
.
Have you tried upgrading this project to angular 4.1.1, @ngtools/webpack 1.3.1, webpack 2.2.1 (or newer), typescript 2.2.1 (or newer)? Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.