Skip to content

[Bug]: Webpack config file initial state. #1270

@Louai99k

Description

@Louai99k

Link to the documentation page or resource

https://docs.strapi.io/developer-docs/latest/development/admin-customization.html#webpack-configuration

Describe the bug

In the documentation it shows that the webpack config file should export an object that contains a function named webpack. But in the source code and to be able to configure the webpack you need to export a function directly from that file.

In the docs:

module.exports = {
  // WARNING: the admin panel now uses webpack 5 to bundle the application.
  webpack: (config, webpack) => {
    // Note: we provide webpack above so you should not `require` it

    // Perform customizations to webpack config
    config.plugins.push(new webpack.IgnorePlugin(/\/__tests__\//));

    // Important: return the modified config
    return config;
  },
};

What it should look like:

module.exports = (config, webpack) => {
   // Note: we provide webpack above so you should not `require` it

  // Perform customizations to webpack config
  config.plugins.push(new webpack.IgnorePlugin(/\/__tests__\//));

  // Important: return the modified config
  return config;
};

This issue is mentioned previously to @kasonde .

Additional context

No response

Suggested improvements or fixes

No response

Related issue(s)/PR(s)

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions