Skip to content
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

feat(@angular/cli): name lazy chunks #6881

Merged
merged 1 commit into from
Jul 5, 2017
Merged

Conversation

filipesilva
Copy link
Contributor

Before:

$ ng build --no-progress
Hash: ff03df269349b817eef4
Time: 11202ms
chunk    {0} 0.chunk.js, 0.chunk.js.map 1.61 kB {1} {3} [rendered]
chunk    {1} 1.chunk.js, 1.chunk.js.map 1.46 kB {0} {3} [rendered]
chunk    {2} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 160 kB {6} [initial] [rendered]
chunk    {3} main.bundle.js, main.bundle.js.map (main) 6.38 kB {5} [initial] [rendered]
chunk    {4} styles.bundle.js, styles.bundle.js.map (styles) 10.5 kB {6} [initial] [rendered]
chunk    {5} vendor.bundle.js, vendor.bundle.js.map (vendor) 2.16 MB [initial] [rendered]
chunk    {6} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]

After:

$ ng build --no-progress
Hash: 2bc12a89f40f3b4818b5
Time: 9613ms
chunk {feature.module} feature.module.chunk.js, feature.module.chunk.js.map 1.46 kB {lazy.module} {main} [rendered]
chunk {inline} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]
chunk {lazy.module} lazy.module.chunk.js, lazy.module.chunk.js.map 1.61 kB {feature.module} {main} [rendered]
chunk {main} main.bundle.js, main.bundle.js.map (main) 6.38 kB {vendor} [initial] [rendered]
chunk {polyfills} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 160 kB {inline} [initial] [rendered]
chunk {styles} styles.bundle.js, styles.bundle.js.map (styles) 10.5 kB {inline} [initial] [rendered]
chunk {vendor} vendor.bundle.js, vendor.bundle.js.map (vendor) 2.16 MB [initial] [rendered]

Fix #6700

return name();
};

return new (webpack as any).NamedChunksPlugin(function (chunk: any) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's best practice for a constructor to return another class. Could you instead extends NamedChunksPlugin?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@filipesilva filipesilva force-pushed the named-chunks branch 4 times, most recently from 56deef3 to d8dd3eb Compare July 4, 2017 20:26
@filipesilva filipesilva requested review from hansl and Brocco July 4, 2017 21:48
Before:
```
$ ng build --no-progress
Hash: ff03df269349b817eef4
Time: 11202ms
chunk    {0} 0.chunk.js, 0.chunk.js.map 1.61 kB {1} {3} [rendered]
chunk    {1} 1.chunk.js, 1.chunk.js.map 1.46 kB {0} {3} [rendered]
chunk    {2} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 160 kB {6} [initial] [rendered]
chunk    {3} main.bundle.js, main.bundle.js.map (main) 6.38 kB {5} [initial] [rendered]
chunk    {4} styles.bundle.js, styles.bundle.js.map (styles) 10.5 kB {6} [initial] [rendered]
chunk    {5} vendor.bundle.js, vendor.bundle.js.map (vendor) 2.16 MB [initial] [rendered]
chunk    {6} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]
```

After:
```
$ ng build --no-progress
Hash: 2bc12a89f40f3b4818b5
Time: 9613ms
chunk {feature.module} feature.module.chunk.js, feature.module.chunk.js.map 1.46 kB {lazy.module} {main} [rendered]
chunk {inline} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]
chunk {lazy.module} lazy.module.chunk.js, lazy.module.chunk.js.map 1.61 kB {feature.module} {main} [rendered]
chunk {main} main.bundle.js, main.bundle.js.map (main) 6.38 kB {vendor} [initial] [rendered]
chunk {polyfills} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 160 kB {inline} [initial] [rendered]
chunk {styles} styles.bundle.js, styles.bundle.js.map (styles) 10.5 kB {inline} [initial] [rendered]
chunk {vendor} vendor.bundle.js, vendor.bundle.js.map (vendor) 2.16 MB [initial] [rendered]
```

Fix angular#6700
Copy link
Contributor

@hansl hansl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hansl hansl merged commit 5a0e80f into angular:master Jul 5, 2017
@filipesilva filipesilva deleted the named-chunks branch July 5, 2017 21:52
filipesilva added a commit to filipesilva/angular-cli that referenced this pull request Jul 10, 2017
Followup to angular#6881

Also name chunks created via `import()` or `System.import()`.
filipesilva added a commit to filipesilva/angular-cli that referenced this pull request Jul 10, 2017
Followup to angular#6881

Also name chunks created via `import()` or `System.import()`, and strip `.ngfactory` from the chunk name.
filipesilva added a commit to filipesilva/angular-cli that referenced this pull request Jul 10, 2017
Followup to angular#6881

Also name chunks created via `import()` or `System.import()`, and strip `.ngfactory` from the chunk name.
hansl pushed a commit that referenced this pull request Jul 10, 2017
Followup to #6881

Also name chunks created via `import()` or `System.import()`, and strip `.ngfactory` from the chunk name.
hansl pushed a commit that referenced this pull request Jul 12, 2017
Followup to #6881

Also name chunks created via `import()` or `System.import()`, and strip `.ngfactory` from the chunk name.
filipesilva added a commit to filipesilva/angular-cli that referenced this pull request Jul 17, 2017
Followup to angular#6881

Allow controlling chunk naming via the `--named-chunks` flag, which can be set on `.angular-cli.json` as well.

Defaults to true in development, false in production.
filipesilva added a commit to filipesilva/angular-cli that referenced this pull request Jul 18, 2017
Followup to angular#6881

Allow controlling chunk naming via the `--named-chunks` flag, which can be set on `.angular-cli.json` as well.

Defaults to true in development, false in production.
filipesilva added a commit to filipesilva/angular-cli that referenced this pull request Jul 18, 2017
Followup to angular#6881

Allow controlling chunk naming via the `--named-chunks` flag, which can be set on `.angular-cli.json` as well.

Defaults to true in development, false in production.
filipesilva added a commit to filipesilva/angular-cli that referenced this pull request Jul 19, 2017
Followup to angular#6881

Allow controlling chunk naming via the `--named-chunks` flag, which can be set on `.angular-cli.json` as well.

Defaults to true in development, false in production.
filipesilva added a commit to filipesilva/angular-cli that referenced this pull request Jul 19, 2017
Followup to angular#6881

Allow controlling chunk naming via the `--named-chunks` flag, which can be set on `.angular-cli.json` as well.

Defaults to true in development, false in production.
filipesilva added a commit to filipesilva/angular-cli that referenced this pull request Jul 19, 2017
Followup to angular#6881

Allow controlling chunk naming via the `--named-chunks` flag, which can be set on `.angular-cli.json` as well.

Defaults to true in development, false in production.
filipesilva added a commit to filipesilva/angular-cli that referenced this pull request Jul 19, 2017
Followup to angular#6881

Allow controlling chunk naming via the `--named-chunks` flag, which can be set on `.angular-cli.json` as well.

Defaults to true in development, false in production.
Brocco pushed a commit that referenced this pull request Jul 19, 2017
Followup to #6881

Allow controlling chunk naming via the `--named-chunks` flag, which can be set on `.angular-cli.json` as well.

Defaults to true in development, false in production.
dond2clouds pushed a commit to d2clouds/speedray-cli that referenced this pull request Apr 23, 2018
Followup to angular#6881

Also name chunks created via `import()` or `System.import()`, and strip `.ngfactory` from the chunk name.
dond2clouds pushed a commit to d2clouds/speedray-cli that referenced this pull request Apr 23, 2018
Followup to angular#6881

Allow controlling chunk naming via the `--named-chunks` flag, which can be set on `.angular-cli.json` as well.

Defaults to true in development, false in production.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Descriptive naming convention for chunks
4 participants