From 1f2c329ed75d00f115934ada7cb31cf54a10661f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Ka=CC=88gy?= Date: Mon, 6 May 2024 16:35:15 +0200 Subject: [PATCH] add code example --- packages/toolkit/README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/toolkit/README.md b/packages/toolkit/README.md index 7a613f8a..54b566e1 100644 --- a/packages/toolkit/README.md +++ b/packages/toolkit/README.md @@ -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