Skip to content

Migrate to webpack-blocks v1 #4

@louisremi

Description

@louisremi

Webpack-block v1 is a release candidate and the API for blocks has changed a bit, see https://github.com/andywer/webpack-blocks/blob/master/docs/BLOCK-CREATION.md

I believe your block should now be:

function serverSourceMap(devtool = 'source-map') {
  return (context, { addPlugin }) => {
    return (prevConfig) => {
      return Object.assign(
        addPlugin(new webpack.BannerPlugin({
          banner: 'require("source-map-support").install();',
          raw: true,
          entryOnly: false,
        }))(prevConfig),
        { devtool }
      );
    };
  };
}

I was too lazy to write a PR, but let me know if you'd be interested.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions