How to get absolute path of entry file in custom webpack plugin?

Viewed 21

i am trying to write custom plugin for webpack. In my case i want to import result bundle as a node js module after build is done.

How can i properly get absolute path of entry file (in my plugin from compiler) for require/import it?

There is example:

class RunBundleAfterBuildPlugin implements WebpackPluginInstance {
  apply(compiler: Compiler) {
    compiler.hooks.thisCompilation.tap('RunBundleAfterBuildPlugin', compilation => {
      compilation.hooks.processAssets.tap('RunBundleAfterBuildPlugin', assets => {
        // i need to get absolute path of entry filename here 
        console.log(assets);
      });
    });
  }
}
0 Answers
Related