Skip to content

Instantly share code, notes, and snippets.

@zakariabinsaifullah
Created August 28, 2023 02:22
Show Gist options
  • Save zakariabinsaifullah/3c864dfe3ce37285f7759b2428f5f194 to your computer and use it in GitHub Desktop.
Save zakariabinsaifullah/3c864dfe3ce37285f7759b2428f5f194 to your computer and use it in GitHub Desktop.
webpack config for gutenberg block development
const path = require('path');
const defaultConfig = require('@wordpress/scripts/config/webpack.config');
const { getWebpackEntryPoints } = require('@wordpress/scripts/utils/config');
module.exports = {
...defaultConfig,
entry: {
...getWebpackEntryPoints(),
'global/global': path.resolve(process.cwd(), 'src', 'global', 'index.js')
},
output: {
...defaultConfig.output,
filename: '[name].js',
path: path.resolve(process.cwd(), 'build')
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment