Webpack 4 Plugin: Add module and get result from loader
问题 I am making a Webpack 4 plugin for fun and to try to understand its internals. The idea is simple: Parse an HTML template file into a tree; Get the asset paths from <img src="..."> and <link href="..."> ; Add the assets to dependencies to load them through the file-loader ; Get the path emitted from file-loader (which might include a hash)and fix the nodes in the tree; Emit the final HTML string into a file. So far, I am stuck at step 4 . Parsing the template and extracting the asset paths