Skip to content

Instantly share code, notes, and snippets.

@andreawetzel
Created April 11, 2024 17:22
Show Gist options
  • Save andreawetzel/42f927321e4b7e50027041eca3fcaef8 to your computer and use it in GitHub Desktop.
Save andreawetzel/42f927321e4b7e50027041eca3fcaef8 to your computer and use it in GitHub Desktop.
custom wordpress webpack config
/**
* Adds Webpack entry points for customizations to core blocks
* in addition to wp-scripts deafault configs that are used for custom blocks
*/
/**
* External dependencies
*/
const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
const path = require( 'path' );
/**
* Add files are exported to in the /build folder
*/
module.exports = {
...defaultConfig,
entry: {
...defaultConfig.entry(),
'enable-center-on-mobile/editor': path.resolve(
process.cwd(),
'src/enable-center-on-mobile',
'editor.scss'
),
'enable-center-on-mobile/frontend': path.resolve(
process.cwd(),
'src/enable-center-on-mobile',
'frontend.js'
),
'enable-center-on-mobile/index': path.resolve(
process.cwd(),
'src/enable-center-on-mobile',
'index.js'
),
'enable-center-on-mobile/style': path.resolve(
process.cwd(),
'src/enable-center-on-mobile',
'index.scss'
),
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment