Created
April 11, 2024 17:22
-
-
Save andreawetzel/42f927321e4b7e50027041eca3fcaef8 to your computer and use it in GitHub Desktop.
custom wordpress webpack config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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