Skip to content

Commit

Permalink
add code example
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiankaegy committed May 6, 2024
1 parent 0e1087b commit 1f2c329
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/toolkit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,25 @@ module.exports = config;

> [!NOTE]
> When `useScriptModules` mode is enabled the config returned from webpack here changes from an object to an array of two objects. The first one is the scripts config which matches the traditional structure. And the second object is the config for the ESM instance.
> ```js
> // webpack.config.js
> const config = require("10up-toolkit/config/webpack.config.js");
> const ProjectSpecificPlugin = require("project-specific-plugin");
>
> // We can now either add it to the first standard config
> config[0].plugins.push(
> // Append project specific plugin config.
> new ProjectSpecificPlugin()
> );
>
> // or to the second module specific config
> config[1].plugins.push(
> // Append project specific plugin config.
> new ProjectSpecificPlugin()
> );
>
> module.exports = config;
>```
### Customizing eslint and styling
Expand Down

0 comments on commit 1f2c329

Please sign in to comment.