webpack-rtl-plugin
webpack-rtl-plugin copied to clipboard
Plugin reading from chunks instead of assets
This plugin uses the emit event of the compiler. According to the webpack docs, at this stage "the Compiler begins with emitting the generated assets. Here plugins have the last chance to add assets to the c.assets array." At this point in the webpack process I don't think it is correct for WebpackRtlPlugin to be using and updating the compilation chunks for operations. It should instead be using the compilation assets.
In one of my use cases for this plugin, I am using AddAssetHtmlPlugin to add some additional css files. AddAssetHtmlPlugin is being executed before WebpackRtlPlugin and is only adding assets to compilation.assets and not compilations.chunks, resulting in WebpackRtlPlugin not building the rtl version of these assets.