Skip to content

Commit

Permalink
Get rid of getEntryModules
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed May 9, 2020
1 parent f71ac84 commit 8f66e6e
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/ModuleLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,6 @@ export class ModuleLoader {

assignManualChunks(getManualChunk: GetManualChunk) {
const manualChunksApi = {
getEntryModuleIds: () =>
this.indexedEntryModules.map(({ module: { id } }) => id)[Symbol.iterator](),
getModuleIds: () => this.modulesById.keys(),
getModuleInfo: this.graph.getModuleInfo
};
Expand Down
1 change: 0 additions & 1 deletion src/rollup/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,6 @@ export interface TreeshakingOptions {
unknownGlobalSideEffects?: boolean;
}
interface GetManualChunkApi {
getEntryModuleIds: () => IterableIterator<string>;
getModuleIds: () => IterableIterator<string>;
getModuleInfo: GetModuleInfo;
}
Expand Down
1 change: 1 addition & 0 deletions src/utils/PluginContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export function getPluginContexts(
meta: {
rollupVersion
},
// TODO Lukas also add getmoduleids and soft-deprecate
get moduleIds() {
return graph.moduleById.keys();
},
Expand Down
3 changes: 1 addition & 2 deletions test/function/samples/manual-chunks-info/_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ module.exports = {
description: 'provides additional chunk information to a manualChunks function',
options: {
external: 'external',
manualChunks(id, { getEntryModuleIds, getModuleIds, getModuleInfo }) {
assert.deepStrictEqual([...getEntryModuleIds()], [getId('main')]);
manualChunks(id, { getModuleIds, getModuleInfo }) {
assert.deepStrictEqual(
[...getModuleIds()],
[getId('main'), 'external', getId('lib'), getId('dynamic')]
Expand Down

0 comments on commit 8f66e6e

Please sign in to comment.