-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lazy loaded file using a string from ./src does not generate chunk with --aot #4156
Comments
Tested on the current build for AngularCli @angular/cli: 1.0.0-beta.30
node: 7.5.0
os: darwin x64
@angular/common: 2.4.7
@angular/compiler: 2.4.7
@angular/core: 2.4.7
@angular/forms: 2.4.7
@angular/http: 2.4.7
@angular/platform-browser: 2.4.7
@angular/platform-browser-dynamic: 2.4.7
@angular/router: 3.4.7
@angular/cli: 1.0.0-beta.30
@angular/compiler-cli: 2.4.7 With 3 lazy loaded files as shown below and doing Code in Main.ts
Build Output: ~/w/o/t/test-project master *… ng build --aot Thu 9 Feb 12:36:54 2017
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
Hash: e6b6eb13d3a1f51f3cd5
Time: 4818ms
chunk {0} 0.chunk.js, 0.bundle.map 100 bytes {4} [rendered]
chunk {1} 1.chunk.js, 1.bundle.map 99 bytes {4} [rendered]
chunk {2} 2.chunk.js, 2.bundle.map 100 bytes {4} [rendered]
chunk {3} polyfills.bundle.js, polyfills.bundle.map (polyfills) 147 kB {7} [initial] [rendered]
chunk {4} main.bundle.js, main.bundle.map (main) 27.9 kB {6} [initial] [rendered]
chunk {5} styles.bundle.js, styles.bundle.map (styles) 10 kB {7} [initial] [rendered]
chunk {6} vendor.bundle.js, vendor.bundle.map (vendor) 1.16 MB [initial] [rendered]
chunk {7} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry] [rendered]
~/w/o/t/test-project master *… cd dist/ 8.2s Thu 9 Feb 12:37:04 2017
~/w/o/t/test-project master * dist ls -l Thu 9 Feb 12:38:06 2017
total 6728
-rw-r--r-- 1 sumitarora staff 107 9 Feb 12:37 0.bundle.map
-rw-r--r-- 1 sumitarora staff 218 9 Feb 12:37 0.chunk.js
-rw-r--r-- 1 sumitarora staff 107 9 Feb 12:37 1.bundle.map
-rw-r--r-- 1 sumitarora staff 217 9 Feb 12:37 1.chunk.js
-rw-r--r-- 1 sumitarora staff 107 9 Feb 12:37 2.bundle.map
-rw-r--r-- 1 sumitarora staff 218 9 Feb 12:37 2.chunk.js
-rw-r--r-- 1 sumitarora staff 5430 9 Feb 12:37 favicon.ico
-rw-r--r-- 1 sumitarora staff 614 9 Feb 12:37 index.html
-rw-r--r-- 1 sumitarora staff 5761 9 Feb 12:37 inline.bundle.js
-rw-r--r-- 1 sumitarora staff 5824 9 Feb 12:37 inline.bundle.map
-rw-r--r-- 1 sumitarora staff 41923 9 Feb 12:37 main.bundle.js
-rw-r--r-- 1 sumitarora staff 42069 9 Feb 12:37 main.bundle.map
-rw-r--r-- 1 sumitarora staff 157697 9 Feb 12:37 polyfills.bundle.js
-rw-r--r-- 1 sumitarora staff 192668 9 Feb 12:37 polyfills.bundle.map
-rw-r--r-- 1 sumitarora staff 10302 9 Feb 12:37 styles.bundle.js
-rw-r--r-- 1 sumitarora staff 13888 9 Feb 12:37 styles.bundle.map
-rw-r--r-- 1 sumitarora staff 1386116 9 Feb 12:37 vendor.bundle.js
-rw-r--r-- 1 sumitarora staff 1524998 9 Feb 12:37 vendor.bundle.map |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Having an empty
src/lazy-file.ts
and the following code inmain.ts
(or in any other file, adjusting the relative path):Running
ng build --aot
will not generate the lazy loaded chunk0.chunk.js
. This chunk is generated in non-aot mode, and is also generated iflazy-file.ts
is in any other directory than.src/
.Using
System.import('./lazy-file.ts');
also works.Note:
System.import
is only available after #4153 is merged.The text was updated successfully, but these errors were encountered: