{"id":46397,"date":"2025-08-16T08:33:49","date_gmt":"2025-08-16T08:33:49","guid":{"rendered":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/?p=46397"},"modified":"2025-08-16T08:34:29","modified_gmt":"2025-08-16T08:34:29","slug":"wp-scripts-custom-config","status":"publish","type":"post","link":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-scripts-custom-config\/","title":{"rendered":"WP Scripts Custom Config"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"code-snippet\">Code Snippet<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Creating a custom webpack configuration file for @WordPress\/Scripts<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create \u201cwebpack.config.js\u201d in the plugn root<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">\/\/ Import the original config from the @wordpress\/scripts package.\nconst defaultConfig = require('@wordpress\/scripts\/config\/webpack.config');\n\n\/\/ Import the helper to find and generate the entry points in the src directory\nconst { getWebpackEntryPoints } = require('@wordpress\/scripts\/utils\/config');\n\n\/\/ Add any a new entry point by extending the webpack config.\nmodule.exports = {\n\t...defaultConfig,\n\tentry: {\n\t\t...getWebpackEntryPoints(),\n\t\t'variation-icon': '.\/src\/variation-icon.js',\n\t},\n};<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Code Snippet Creating a custom webpack configuration file for @WordPress\/Scripts Create \u201cwebpack.config.js\u201d in the plugn root<\/p>\n","protected":false},"author":1,"featured_media":46399,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"WP Scripts Custom Config - Code DPlugins","description":"Code Snippet Creating a custom webpack configuration file for @WordPress\/Scripts Create \u201cwebpack.config.js\u201d in the plugn root"},"_slim_seo_primary_term_category":0,"_slim_seo_primary_term_post_tag":0,"footnotes":""},"categories":[90],"tags":[107,111,112],"dpc_library":[],"class_list":["post-46397","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-gutenberg","tag-build","tag-config","tag-webpack"],"_links":{"self":[{"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/posts\/46397","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/comments?post=46397"}],"version-history":[{"count":0,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/posts\/46397\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/media\/46399"}],"wp:attachment":[{"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/media?parent=46397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/categories?post=46397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/tags?post=46397"},{"taxonomy":"dpc_library","embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/dpc_library?post=46397"}],"curies":[{"name":"wp","href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/api.w.org\/{rel}","templated":true}]}}