Skip to content

Instantly share code, notes, and snippets.

@landbryo
Created October 31, 2022 01:33
Show Gist options
  • Save landbryo/346d2d8b8822a9a9123ef882bff7e5b6 to your computer and use it in GitHub Desktop.
Save landbryo/346d2d8b8822a9a9123ef882bff7e5b6 to your computer and use it in GitHub Desktop.
Example webpack.config.js file for extending wp-scripts build.
/**
* External Dependencies
*/
const path = require('path');
/**
* WordPress Dependencies
*/
const defaultConfig = require('@wordpress/scripts/config/webpack.config.js');
module.exports = {
...defaultConfig,
...{
entry: {
'admin-scripts': path.resolve(process.cwd(), 'src', 'admin.js'),
'public-scripts': path.resolve(process.cwd(), 'src', 'public.js'),
},
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment