Skip to content

webpack plugin #22

@pwmckenna

Description

@pwmckenna

I just wanted to analyze the output of webpack from within a plugin, and it took quite a bit of poking to line up the chicken bones.

function StringsPlugin() {}

StringsPlugin.prototype.apply = function (compiler) {
  compiler.plugin('after-emit', function (compilation) {
    Object.keys(compilation.assets).forEach(function (basename) {
      console.log(compilation.assets[basename].source());
    });
  });
};

module.exports = StringsPlugin;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions