You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.
I've ran into an issue using this plugin with multi compiler mode only outputting the last assets into the manifest. This is a problem that has been solved on the webpack-manifest-plugin, where they allow you to specify a cache object, which then adds to the manifest in every multi-compile.
I've had a go at getting copying their method into this plugin, which seems to work
var_=require('lodash')/** * Create a new StatsPlugin that causes webpack to generate a stats file as * part of the emitted assets. * @constructor * @param {String} output Path to output file. * @param {Object} options Options passed to the stats' `.toJson()`. */functionStatsPlugin(output,options,cache){this.output=outputthis.options=optionsthis.cache=cache||{}}StatsPlugin.prototype.apply=functionapply(compiler){varoutput=this.outputvaroptions=this.optionsvarcache=this.cachecompiler.plugin('emit',functiononEmit(compilation,done){varstats=compilation.getStats().toJson(options)cache=_.merge(cache,stats)varjson=JSON.stringify(cache,null,2)compilation.assets[output]={size: functiongetSize(){returnjson&&json.length||0},source: functiongetSource(){returnjson}}done()})}module.exports=StatsPlugin
Is this something you'd be interested in incorporating into this plugin? And could I raise a PR to do so?
To give some context as why I want to do this; I am creating several themed bundles using themed-sass-loader within a webpack-rails app. Webpack-rails uses the manifest to load in the correct assets, and checks it for errors, etc., so an entry for each theme is needed.
The text was updated successfully, but these errors were encountered:
I've ran into an issue using this plugin with multi compiler mode only outputting the last assets into the manifest. This is a problem that has been solved on the webpack-manifest-plugin, where they allow you to specify a
cache
object, which then adds to the manifest in every multi-compile.I've had a go at getting copying their method into this plugin, which seems to work
Is this something you'd be interested in incorporating into this plugin? And could I raise a PR to do so?
To give some context as why I want to do this; I am creating several themed bundles using themed-sass-loader within a webpack-rails app. Webpack-rails uses the manifest to load in the correct assets, and checks it for errors, etc., so an entry for each theme is needed.
The text was updated successfully, but these errors were encountered: