UNPKG

@gravityforms/gulp-tasks

Version:
35 lines (32 loc) 1.08 kB
/** * External Dependencies */ const { mergeWithCustomize, customizeArray } = require( 'webpack-merge' ); /** * Internal Dependencies */ const prodBase = require( './configs/prod-base.js' ); const externals = require( './externals/admin' ); const getConfig = require( '../../config' ); const { config } = getConfig(); const pluginOverrides = Array.isArray( config.webpack?.overrides?.plugins?.release?.admin ) ? config.webpack.overrides.plugins.release.admin : []; module.exports = mergeWithCustomize( { customizeArray: customizeArray( { optimization: 'append', plugins: 'append', } ), } )( prodBase, { externals, entry: { 'admin-components': [ // dist path is only set in packages repo, this is done for now to migrate from the old way of generating these. config.paths.components_dist ? `${ config.paths.components_dist }/js/entry/admin.js` : `${ config.paths.components_src }/entry/admin.js`, ], }, output: { path: config.paths.components_dist ? `${ config.paths.components_dist }/js/` : config.paths.js_dist, }, plugins: pluginOverrides, } );