* Returns true if the module can be placed in the chunk. * @param {Chunk} chunk the chunk which condition should be checked * @param {Compilation} compilation the compilation * @returns {boolean} true if the module can be placed in the chunk
(chunk, compilation)
| 838 | * @returns {boolean} true if the module can be placed in the chunk |
| 839 | */ |
| 840 | chunkCondition(chunk, compilation) { |
| 841 | const { chunkCondition } = ExternalModule.getCompilationHooks(compilation); |
| 842 | const condition = chunkCondition.call(chunk, compilation); |
| 843 | if (condition !== undefined) return condition; |
| 844 | |
| 845 | const type = this._resolveExternalType(this.externalType); |
| 846 | |
| 847 | // For `import()` externals, keep them in the initial chunk to avoid loading |
| 848 | // them asynchronously twice and to improve runtime performance. |
| 849 | if (["css-import", "module"].includes(type)) { |
| 850 | return true; |
| 851 | } |
| 852 | return compilation.chunkGraph.getNumberOfEntryModules(chunk) > 0; |
| 853 | } |
| 854 | |
| 855 | /** |
| 856 | * Returns the unique identifier used to reference this module. |
nothing calls this directly
no test coverage detected