Skip to content

Instantly share code, notes, and snippets.

@wpflames
Created October 1, 2022 15:41
Show Gist options
  • Select an option

  • Save wpflames/abaf6918582257e4cd36acf75aad81cc to your computer and use it in GitHub Desktop.

Select an option

Save wpflames/abaf6918582257e4cd36acf75aad81cc to your computer and use it in GitHub Desktop.
Changing file entry and output of build scripts
const path = require('path');
const defaultConfig = require("./node_modules/@wordpress/scripts/config/webpack.config");
module.exports = {
...defaultConfig,
entry: {
index: path.resolve( __dirname, 'assets/js', 'index.js' ),
},
output: {
filename: '[name].js',
path: path.resolve( __dirname, 'dist/js' ),
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment