Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
langs.forEach( lang => config.entry[`docs-${ lang }`] = path.resolve( process.cwd(), `docs/${ lang }`, 'index.js' ) )
config.resolve.alias['@docs'] = path.resolve(process.cwd(), 'docs/')
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';
langs.forEach( lang => config.entry[`docs-${ lang }`] = path.resolve( process.cwd(), `docs/${ lang }`, 'index.js' ) )
config.resolve.alias['@docs'] = path.resolve(process.cwd(), 'docs/')