Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Load Preset
const webpackMerge = require("webpack-merge");
const applyPresets = (env = { presets: [] }) => {
const presets = env.presets || [];
/** @type {string[]} */
const mergedPresets = [].concat(...[presets]);
const mergedConfigs = mergedPresets.map(presetName => require(`./presets/webpack.${presetName}`)(env));
return webpackMerge({}, ...mergedConfigs);
};
module.exports = applyPresets;
@LinKassem

This comment has been minimized.

Copy link

commented Apr 20, 2019

@TheLarkInn, can you please provide a full example on how this can be used with the webpack.config.js ? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.