webpack-rtl-plugin icon indicating copy to clipboard operation
webpack-rtl-plugin copied to clipboard

Plugin reading from chunks instead of assets

Open mmmoussa opened this issue 7 years ago • 0 comments

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.

mmmoussa avatar Dec 11 '17 17:12 mmmoussa