* Creates a dependency. * @param {string} entry entry request * @param {EntryOptions | string} options entry options (passing string is deprecated) * @returns {EntryDependency} the dependency
(entry, options)
| 60 | * @returns {EntryDependency} the dependency |
| 61 | */ |
| 62 | static createDependency(entry, options) { |
| 63 | const dep = new EntryDependency(entry); |
| 64 | class="cm">// TODO webpack 6 remove string option |
| 65 | dep.loc = { |
| 66 | name: |
| 67 | typeof options === class="st">"object" |
| 68 | ? /** @type {string} */ (options.name) |
| 69 | : options |
| 70 | }; |
| 71 | return dep; |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | module.exports = EntryPlugin; |