Skip to content

Instantly share code, notes, and snippets.

@mrabbani
Created September 21, 2025 01:56
Show Gist options
  • Select an option

  • Save mrabbani/d688599e6496c1f67d4a2f32614fb712 to your computer and use it in GitHub Desktop.

Select an option

Save mrabbani/d688599e6496c1f67d4a2f32614fb712 to your computer and use it in GitHub Desktop.
WordPress FAQ.md

How to build BOTH non-block components and blocks present in the /src directory using @wordpress/scripts

Just add a webpack.config.js file at the root of your project with the following contents:

const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );

module.exports = {
    ...defaultConfig,
    entry: {
        ...defaultConfig.entry(),
        index: './src/index.js',
    },
};

Ref: https://wordpress.stackexchange.com/a/425349/195680

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment