How to use the @wordpress/scripts/config/webpack.config.output function in @wordpress/scripts

To help you get started, we’ve selected a few @wordpress/scripts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GraphQLAPI / graphql-api-for-wp / editor-scripts / endpoint-editor-components / webpack.config.js View on Github external
{
				loader: "markdown-loader"
			}
		]
	}
);

/**
 * Because the block and the package have their own webpack configuration,
 * they must provide a unique name for the global scope (which is used to lazy-load chunks),
 * otherwise it throws a JS error when loading blocks compiled with `npm run build`
 * @see https://github.com/WordPress/gutenberg/issues/23607
 * @see https://webpack.js.org/configuration/output/#outputjsonpfunction
 */
// ------------------------------------------------------
config.output.jsonpFunction = 'webpackJsonpGraphQLAPIEndpointEditorComponents';
// ------------------------------------------------------

module.exports = config;
github GraphQLAPI / graphql-api-for-wp / editor-scripts / persisted-query-editor-components / webpack.config.js View on Github external
{
				loader: "markdown-loader"
			}
		]
	}
);

/**
 * Because the block and the package have their own webpack configuration,
 * they must provide a unique name for the global scope (which is used to lazy-load chunks),
 * otherwise it throws a JS error when loading blocks compiled with `npm run build`
 * @see https://github.com/WordPress/gutenberg/issues/23607
 * @see https://webpack.js.org/configuration/output/#outputjsonpfunction
 */
// ------------------------------------------------------
config.output.jsonpFunction = 'webpackJsonpGraphQLAPIPersistedQueryEditorComponents';
// ------------------------------------------------------

module.exports = config;
github WordPress / learn / wp-content / plugins / wporg-learn / webpack.config.js View on Github external
config.entry = {
	'block-styles': './js/block-styles/index.js',
	'workshop-application-form': './js/workshop-application-form/src/index.js',
	'workshop-details': './js/workshop-details/src/index.js',
}

/**
 * The jsonpFunction is a global function used to load application chunks. If
 * multiple webpack-bundled scripts are on the same page, these functions will
 * conflict. This provides a unique name for this function in our app.
 *
 * @see https://github.com/WordPress/gutenberg/issues/23607
 * @see https://webpack.js.org/configuration/output/#outputjsonpfunction
 * @see https://github.com/WordPress/gutenberg/issues/24321
 */
config.output.jsonpFunction = 'wporgLearnPlugin';

module.exports = config;