How to use the @wordpress/scripts/config/webpack.config.entry 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
langs.forEach( lang => config.entry[`docs-${ lang }`] = path.resolve( process.cwd(), `docs/${ lang }`, 'index.js' ) )
config.resolve.alias['@docs'] = path.resolve(process.cwd(), 'docs/')
github WordPress / learn / wp-content / plugins / wporg-learn / webpack.config.js View on Github external
const config = require( '@wordpress/scripts/config/webpack.config' );

/**
 * Set up the custom entry points.
 */
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';
github GraphQLAPI / graphql-api-for-wp / editor-scripts / persisted-query-editor-components / webpack.config.js View on Github external
langs.forEach( lang => config.entry[`docs-${ lang }`] = path.resolve( process.cwd(), `docs/${ lang }`, 'index.js' ) )
config.resolve.alias['@docs'] = path.resolve(process.cwd(), 'docs/')