\href{http://travis-ci.org/survivejs/webpack-merge}{\texttt{ }} \href{https://codecov.io/gh/survivejs/webpack-merge}{\texttt{ }}\hypertarget{md_sfcode_node_modules_webpack_merge_README_autotoc_md33801}{}\doxysection{webpack-\/merge -\/ Merge designed for Webpack}\label{md_sfcode_node_modules_webpack_merge_README_autotoc_md33801}
{\bfseries{webpack-\/merge}} provides a {\ttfamily merge} function that concatenates arrays and merges objects creating a new object. If functions are encountered, it will execute them, run the results through the algorithm, and then wrap the returned values within a function again.

This behavior is particularly useful in configuring webpack although it has uses beyond it. Whenever you need to merge configuration objects, {\bfseries{webpack-\/merge}} can come in handy.

There\textquotesingle{}s also a webpack specific merge variant known as {\ttfamily merge.\+smart} that\textquotesingle{}s able to take webpack specifics into account (i.\+e., it can flatten loader definitions).\hypertarget{md_sfcode_node_modules_webpack_merge_README_autotoc_md33802}{}\doxysubsection{Standard Merging}\label{md_sfcode_node_modules_webpack_merge_README_autotoc_md33802}
\hypertarget{md_sfcode_node_modules_webpack_merge_README_autotoc_md33803}{}\doxysubsubsection{$\ast$$\ast$$<$tt$>$merge(...\+configuration $\vert$ \mbox{[}...\+configuration\mbox{]})$<$/tt$>$$\ast$$\ast$}\label{md_sfcode_node_modules_webpack_merge_README_autotoc_md33803}
{\ttfamily merge} is the core, and the most important idea, of the API. Often this is all you need unless you want further customization.


\begin{DoxyCode}{0}
\DoxyCodeLine{// Default API}
\DoxyCodeLine{var output = merge(object1, object2, object3, ...);}
\DoxyCodeLine{}
\DoxyCodeLine{// You can pass an array of objects directly.}
\DoxyCodeLine{// This works with all available functions.}
\DoxyCodeLine{var output = merge([object1, object2, object3]);}
\DoxyCodeLine{}
\DoxyCodeLine{// Please note that where keys match,}
\DoxyCodeLine{// the objects to the right take precedence:}
\DoxyCodeLine{var output = merge(}
\DoxyCodeLine{  \{ fruit: "{}apple"{}, color: "{}red"{} \},}
\DoxyCodeLine{  \{ fruit: "{}strawberries"{} \}}
\DoxyCodeLine{);}
\DoxyCodeLine{console.log(output);}
\DoxyCodeLine{// \{ color: "{}red"{}, fruit: "{}strawberries"{}\} }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_webpack_merge_README_autotoc_md33804}{}\doxysubsubsection{$\ast$$\ast$$<$tt$>$merge(\{ customize\+Array, customize\+Object \})(...\+configuration $\vert$ \mbox{[}...\+configuration\mbox{]})$<$/tt$>$$\ast$$\ast$}\label{md_sfcode_node_modules_webpack_merge_README_autotoc_md33804}
{\ttfamily merge} behavior can be customized per field through a curried customization API.


\begin{DoxyCode}{0}
\DoxyCodeLine{// Customizing array/object behavior}
\DoxyCodeLine{var output = merge(}
\DoxyCodeLine{  \{}
\DoxyCodeLine{    customizeArray(a, b, key) \{}
\DoxyCodeLine{      if (key === 'extensions') \{}
\DoxyCodeLine{        return \_.uniq([...a, ...b]);}
\DoxyCodeLine{      \}}
\DoxyCodeLine{}
\DoxyCodeLine{      // Fall back to default merging}
\DoxyCodeLine{      return undefined;}
\DoxyCodeLine{    \},}
\DoxyCodeLine{    customizeObject(a, b, key) \{}
\DoxyCodeLine{      if (key === 'module') \{}
\DoxyCodeLine{        // Custom merging}
\DoxyCodeLine{        return \_.merge(\{\}, a, b);}
\DoxyCodeLine{      \}}
\DoxyCodeLine{}
\DoxyCodeLine{      // Fall back to default merging}
\DoxyCodeLine{      return undefined;}
\DoxyCodeLine{    \}}
\DoxyCodeLine{  \}}
\DoxyCodeLine{)(object1, object2, object3, ...); }

\end{DoxyCode}
 For example, if the previous code was invoked with only {\ttfamily object1} and {\ttfamily object2} with {\ttfamily object1} as\+: 
\begin{DoxyCode}{0}
\DoxyCodeLine{\{}
\DoxyCodeLine{    foo1: ['object1'],}
\DoxyCodeLine{    foo2: ['object1'],}
\DoxyCodeLine{    bar1: \{ object1: \{\} \},}
\DoxyCodeLine{    bar2: \{ object1: \{\} \},}
\DoxyCodeLine{\} }

\end{DoxyCode}
 and {\ttfamily object2} as\+: 
\begin{DoxyCode}{0}
\DoxyCodeLine{\{}
\DoxyCodeLine{    foo1: ['object2'],}
\DoxyCodeLine{    foo2: ['object2'],}
\DoxyCodeLine{    bar1: \{ object2: \{\} \},}
\DoxyCodeLine{    bar2: \{ object2: \{\} \},}
\DoxyCodeLine{\} }

\end{DoxyCode}
 then {\ttfamily customize\+Array} will be invoked for each property of {\ttfamily Array} type, i.\+e\+: 
\begin{DoxyCode}{0}
\DoxyCodeLine{customizeArray(['object1'], ['object2'], 'foo1');}
\DoxyCodeLine{customizeArray(['object1'], ['object2'], 'foo2'); }

\end{DoxyCode}
 and {\ttfamily customize\+Object} will be invoked for each property of {\ttfamily Object} type, i.\+e\+: 
\begin{DoxyCode}{0}
\DoxyCodeLine{customizeObject(\{ object1: \{\} \}, \{ object2: \{\} \}, bar1);}
\DoxyCodeLine{customizeObject(\{ object1: \{\} \}, \{ object2: \{\} \}, bar2); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_webpack_merge_README_autotoc_md33805}{}\doxysubsubsection{$\ast$$\ast$$<$tt$>$merge.\+unique($<$field$>$, $<$fields$>$, field =$>$ field)$<$/tt$>$$\ast$$\ast$}\label{md_sfcode_node_modules_webpack_merge_README_autotoc_md33805}
The first $<$field$>$ is the config property to look through for duplicates.

$<$fields$>$ represents the values that should be unique when you run the field =$>$ field function on each duplicate.


\begin{DoxyCode}{0}
\DoxyCodeLine{const output = merge(\{}
\DoxyCodeLine{  customizeArray: merge.unique(}
\DoxyCodeLine{    'plugins',}
\DoxyCodeLine{    ['HotModuleReplacementPlugin'],}
\DoxyCodeLine{    plugin => plugin.constructor \&\& plugin.constructor.name}
\DoxyCodeLine{  )}
\DoxyCodeLine{\})(\{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new webpack.HotModuleReplacementPlugin()}
\DoxyCodeLine{  ]}
\DoxyCodeLine{\}, \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new webpack.HotModuleReplacementPlugin()}
\DoxyCodeLine{  ]}
\DoxyCodeLine{\});}
\DoxyCodeLine{}
\DoxyCodeLine{// Output contains only single HotModuleReplacementPlugin now. }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_webpack_merge_README_autotoc_md33806}{}\doxysubsection{Merging with Strategies}\label{md_sfcode_node_modules_webpack_merge_README_autotoc_md33806}
\hypertarget{md_sfcode_node_modules_webpack_merge_README_autotoc_md33807}{}\doxysubsubsection{$\ast$$\ast$‘merge.\+strategy(\{ $<$field$>$\+: ’$<$prepend$\vert$append$\vert$replace$>$\textquotesingle{}\textquotesingle{}\})(...\+configuration $\vert$ \mbox{[}...\+configuration\mbox{]})\`{}$\ast$$\ast$}\label{md_sfcode_node_modules_webpack_merge_README_autotoc_md33807}
Given you may want to configure merging behavior per field, there\textquotesingle{}s a strategy variant\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{// Merging with a specific merge strategy}
\DoxyCodeLine{var output = merge.strategy(}
\DoxyCodeLine{  \{}
\DoxyCodeLine{    entry: 'prepend', // or 'replace', defaults to 'append'}
\DoxyCodeLine{    'module.rules': 'prepend'}
\DoxyCodeLine{  \}}
\DoxyCodeLine{)(object1, object2, object3, ...); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_webpack_merge_README_autotoc_md33808}{}\doxysubsubsection{$\ast$$\ast$‘merge.\+smart\+Strategy(\{ $<$key$>$\+: ’$<$prepend$\vert$append$\vert$replace$>$\textquotesingle{}\textquotesingle{}\})(...\+configuration $\vert$ \mbox{[}...\+configuration\mbox{]})\`{}$\ast$$\ast$}\label{md_sfcode_node_modules_webpack_merge_README_autotoc_md33808}
The same idea works with smart merging too (described below in greater detail).


\begin{DoxyCode}{0}
\DoxyCodeLine{var output = merge.smartStrategy(}
\DoxyCodeLine{  \{}
\DoxyCodeLine{    entry: 'prepend', // or 'replace'}
\DoxyCodeLine{    'module.rules': 'prepend'}
\DoxyCodeLine{  \}}
\DoxyCodeLine{)(object1, object2, object3, ...); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_webpack_merge_README_autotoc_md33809}{}\doxysubsection{Smart Merging}\label{md_sfcode_node_modules_webpack_merge_README_autotoc_md33809}
\hypertarget{md_sfcode_node_modules_webpack_merge_README_autotoc_md33810}{}\doxysubsubsection{$\ast$$\ast$$<$tt$>$merge.\+smart(...\+configuration $\vert$ \mbox{[}...\+configuration\mbox{]})$<$/tt$>$$\ast$$\ast$}\label{md_sfcode_node_modules_webpack_merge_README_autotoc_md33810}
{\itshape webpack-\/merge} tries to be smart about merging loaders when {\ttfamily merge.\+smart} is used. Loaders with matching tests will be merged into a single loader value.

Note that the logic picks up webpack 2 {\ttfamily rules} kind of syntax as well. The examples below have been written in webpack 1 syntax.

{\bfseries{package.\+json}}


\begin{DoxyCode}{0}
\DoxyCodeLine{\{}
\DoxyCodeLine{  "{}scripts"{}: \{}
\DoxyCodeLine{    "{}start"{}: "{}webpack-\/dev-\/server"{},}
\DoxyCodeLine{    "{}build"{}: "{}webpack"{}}
\DoxyCodeLine{  \},}
\DoxyCodeLine{  // ...}
\DoxyCodeLine{\} }

\end{DoxyCode}


{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{var path = require('path');}
\DoxyCodeLine{var merge = require('webpack-\/merge');}
\DoxyCodeLine{}
\DoxyCodeLine{var TARGET = process.env.npm\_lifecycle\_event;}
\DoxyCodeLine{}
\DoxyCodeLine{var common = \{}
\DoxyCodeLine{  entry: path.join(\_\_dirname, 'app'),}
\DoxyCodeLine{  ...}
\DoxyCodeLine{  module: \{}
\DoxyCodeLine{    loaders: [}
\DoxyCodeLine{      \{}
\DoxyCodeLine{        test: /\(\backslash\).css\$/,}
\DoxyCodeLine{        loaders: ['style', 'css'],}
\DoxyCodeLine{      \},}
\DoxyCodeLine{    ],}
\DoxyCodeLine{  \},}
\DoxyCodeLine{\};}
\DoxyCodeLine{}
\DoxyCodeLine{if(TARGET === 'start') \{}
\DoxyCodeLine{  module.exports = merge(common, \{}
\DoxyCodeLine{    module: \{}
\DoxyCodeLine{      // loaders will get concatenated!}
\DoxyCodeLine{      loaders: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          test: /\(\backslash\).jsx?\$/,}
\DoxyCodeLine{          loader: 'babel?stage=1',}
\DoxyCodeLine{          include: path.join(ROOT\_PATH, 'app'),}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \},}
\DoxyCodeLine{    ...}
\DoxyCodeLine{  \});}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{if(TARGET === 'build') \{}
\DoxyCodeLine{  module.exports = merge(common, \{}
\DoxyCodeLine{    ...}
\DoxyCodeLine{  \});}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{... }

\end{DoxyCode}


$\ast$$\ast$\+Loader string values `loader\+: \textquotesingle{}babel'\`{} override each other.$\ast$$\ast$


\begin{DoxyCode}{0}
\DoxyCodeLine{merge.smart(\{}
\DoxyCodeLine{  loaders: [\{}
\DoxyCodeLine{    test: /\(\backslash\).js\$/,}
\DoxyCodeLine{    loader: 'babel'}
\DoxyCodeLine{  \}]}
\DoxyCodeLine{\}, \{}
\DoxyCodeLine{  loaders: [\{}
\DoxyCodeLine{    test: /\(\backslash\).js\$/,}
\DoxyCodeLine{    loader: 'coffee'}
\DoxyCodeLine{  \}]}
\DoxyCodeLine{\});}
\DoxyCodeLine{// will become}
\DoxyCodeLine{\{}
\DoxyCodeLine{  loaders: [\{}
\DoxyCodeLine{    test: /\(\backslash\).js\$/,}
\DoxyCodeLine{    loader: 'coffee'}
\DoxyCodeLine{  \}]}
\DoxyCodeLine{\} }

\end{DoxyCode}


$\ast$$\ast$\+Loader array values `loaders\+: \mbox{[}\textquotesingle{}babel'\mbox{]}\`{} will be merged, without duplication.$\ast$$\ast$


\begin{DoxyCode}{0}
\DoxyCodeLine{merge.smart(\{}
\DoxyCodeLine{  loaders: [\{}
\DoxyCodeLine{    test: /\(\backslash\).js\$/,}
\DoxyCodeLine{    loaders: ['babel']}
\DoxyCodeLine{  \}]}
\DoxyCodeLine{\}, \{}
\DoxyCodeLine{  loaders: [\{}
\DoxyCodeLine{    test: /\(\backslash\).js\$/,}
\DoxyCodeLine{    loaders: ['coffee']}
\DoxyCodeLine{  \}]}
\DoxyCodeLine{\});}
\DoxyCodeLine{// will become}
\DoxyCodeLine{\{}
\DoxyCodeLine{  loaders: [\{}
\DoxyCodeLine{    test: /\(\backslash\).js\$/,}
\DoxyCodeLine{    // appended because Webpack evaluated these from right to left}
\DoxyCodeLine{    // this way you can specialize behavior and build the loader chain}
\DoxyCodeLine{    loaders: ['babel', 'coffee']}
\DoxyCodeLine{  \}]}
\DoxyCodeLine{\} }

\end{DoxyCode}


$\ast$$\ast$\+Loader array values `loaders\+: \mbox{[}\textquotesingle{}babel'\mbox{]}\`{} can be reordered by including original loaders.$\ast$$\ast$


\begin{DoxyCode}{0}
\DoxyCodeLine{merge.smart(\{}
\DoxyCodeLine{  loaders: [\{}
\DoxyCodeLine{    test: /\(\backslash\).js\$/,}
\DoxyCodeLine{    loaders: ['babel']}
\DoxyCodeLine{  \}]}
\DoxyCodeLine{\}, \{}
\DoxyCodeLine{  loaders: [\{}
\DoxyCodeLine{    test: /\(\backslash\).js\$/,}
\DoxyCodeLine{    loaders: ['react-\/hot', 'babel']}
\DoxyCodeLine{  \}]}
\DoxyCodeLine{\});}
\DoxyCodeLine{// will become}
\DoxyCodeLine{\{}
\DoxyCodeLine{  loaders: [\{}
\DoxyCodeLine{    test: /\(\backslash\).js\$/,}
\DoxyCodeLine{    // order of second argument is respected}
\DoxyCodeLine{    loaders: ['react-\/hot', 'babel']}
\DoxyCodeLine{  \}]}
\DoxyCodeLine{\} }

\end{DoxyCode}


This also works in reverse -\/ the existing order will be maintained if possible\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{merge.smart(\{}
\DoxyCodeLine{  loaders: [\{}
\DoxyCodeLine{    test: /\(\backslash\).css\$/,}
\DoxyCodeLine{    use: [}
\DoxyCodeLine{      \{ loader: 'css-\/loader', options: \{ myOptions: true \} \},}
\DoxyCodeLine{      \{ loader: 'style-\/loader' \}}
\DoxyCodeLine{    ]}
\DoxyCodeLine{  \}]}
\DoxyCodeLine{\}, \{}
\DoxyCodeLine{  loaders: [\{}
\DoxyCodeLine{    test: /\(\backslash\).css\$/,}
\DoxyCodeLine{    use: [}
\DoxyCodeLine{      \{ loader: 'style-\/loader', options: \{ someSetting: true \} \}}
\DoxyCodeLine{    ]}
\DoxyCodeLine{  \}]}
\DoxyCodeLine{\});}
\DoxyCodeLine{// will become}
\DoxyCodeLine{\{}
\DoxyCodeLine{  loaders: [\{}
\DoxyCodeLine{    test: /\(\backslash\).css\$/,}
\DoxyCodeLine{    use: [}
\DoxyCodeLine{      \{ loader: 'css-\/loader', options: \{ myOptions: true \} \},}
\DoxyCodeLine{      \{ loader: 'style-\/loader', options: \{ someSetting: true \} \}}
\DoxyCodeLine{    ]}
\DoxyCodeLine{  \}]}
\DoxyCodeLine{\} }

\end{DoxyCode}


In the case of an order conflict, the second order wins\+: 
\begin{DoxyCode}{0}
\DoxyCodeLine{merge.smart(\{}
\DoxyCodeLine{  loaders: [\{}
\DoxyCodeLine{    test: /\(\backslash\).css\$/,}
\DoxyCodeLine{    use: [}
\DoxyCodeLine{      \{ loader: 'css-\/loader' \},}
\DoxyCodeLine{      \{ loader: 'style-\/loader' \}}
\DoxyCodeLine{    ]}
\DoxyCodeLine{  \}]}
\DoxyCodeLine{\}, \{}
\DoxyCodeLine{  loaders: [\{}
\DoxyCodeLine{    test: /\(\backslash\).css\$/,}
\DoxyCodeLine{    use: [}
\DoxyCodeLine{      \{ loader: 'style-\/loader' \},}
\DoxyCodeLine{      \{ loader: 'css-\/loader' \}}
\DoxyCodeLine{    ]}
\DoxyCodeLine{  \}]}
\DoxyCodeLine{\});}
\DoxyCodeLine{// will become}
\DoxyCodeLine{\{}
\DoxyCodeLine{  loaders: [\{}
\DoxyCodeLine{    test: /\(\backslash\).css\$/,}
\DoxyCodeLine{    use: [}
\DoxyCodeLine{      \{ loader: 'style-\/loader' \}}
\DoxyCodeLine{      \{ loader: 'css-\/loader' \},}
\DoxyCodeLine{    ]}
\DoxyCodeLine{  \}]}
\DoxyCodeLine{\} }

\end{DoxyCode}


$\ast$$\ast$\+Loader query strings `loaders\+: \mbox{[}\textquotesingle{}babel?plugins\mbox{[}\mbox{]}=object-\/assign'\mbox{]}\`{} will be overridden.$\ast$$\ast$


\begin{DoxyCode}{0}
\DoxyCodeLine{merge.smart(\{}
\DoxyCodeLine{  loaders: [\{}
\DoxyCodeLine{    test: /\(\backslash\).js\$/,}
\DoxyCodeLine{    loaders: ['babel?plugins[]=object-\/assign']}
\DoxyCodeLine{  \}]}
\DoxyCodeLine{\}, \{}
\DoxyCodeLine{  loaders: [\{}
\DoxyCodeLine{    test: /\(\backslash\).js\$/,}
\DoxyCodeLine{    loaders: ['babel', 'coffee']}
\DoxyCodeLine{  \}]}
\DoxyCodeLine{\});}
\DoxyCodeLine{// will become}
\DoxyCodeLine{\{}
\DoxyCodeLine{  loaders: [\{}
\DoxyCodeLine{    test: /\(\backslash\).js\$/,}
\DoxyCodeLine{    loaders: ['babel', 'coffee']}
\DoxyCodeLine{  \}]}
\DoxyCodeLine{\} }

\end{DoxyCode}


{\bfseries{Loader arrays in source values will have loader strings merged into them.}}


\begin{DoxyCode}{0}
\DoxyCodeLine{merge.smart(\{}
\DoxyCodeLine{  loaders: [\{}
\DoxyCodeLine{    test: /\(\backslash\).js\$/,}
\DoxyCodeLine{    loader: 'babel'}
\DoxyCodeLine{  \}]}
\DoxyCodeLine{\}, \{}
\DoxyCodeLine{  loaders: [\{}
\DoxyCodeLine{    test: /\(\backslash\).js\$/,}
\DoxyCodeLine{    loaders: ['coffee']}
\DoxyCodeLine{  \}]}
\DoxyCodeLine{\});}
\DoxyCodeLine{// will become}
\DoxyCodeLine{\{}
\DoxyCodeLine{  loaders: [\{}
\DoxyCodeLine{    test: /\(\backslash\).js\$/,}
\DoxyCodeLine{    // appended because Webpack evaluated these from right to left!}
\DoxyCodeLine{    loaders: ['babel', 'coffee']}
\DoxyCodeLine{  \}]}
\DoxyCodeLine{\} }

\end{DoxyCode}


{\bfseries{Loader strings in source values will always override.}}


\begin{DoxyCode}{0}
\DoxyCodeLine{merge.smart(\{}
\DoxyCodeLine{  loaders: [\{}
\DoxyCodeLine{    test: /\(\backslash\).js\$/,}
\DoxyCodeLine{    loaders: ['babel']}
\DoxyCodeLine{  \}]}
\DoxyCodeLine{\}, \{}
\DoxyCodeLine{  loaders: [\{}
\DoxyCodeLine{    test: /\(\backslash\).js\$/,}
\DoxyCodeLine{    loader: 'coffee'}
\DoxyCodeLine{  \}]}
\DoxyCodeLine{\});}
\DoxyCodeLine{// will become}
\DoxyCodeLine{\{}
\DoxyCodeLine{  loaders: [\{}
\DoxyCodeLine{    test: /\(\backslash\).js\$/,}
\DoxyCodeLine{    loader: 'coffee'}
\DoxyCodeLine{  \}]}
\DoxyCodeLine{\} }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_webpack_merge_README_autotoc_md33811}{}\doxysubsection{Multiple Merging}\label{md_sfcode_node_modules_webpack_merge_README_autotoc_md33811}
\hypertarget{md_sfcode_node_modules_webpack_merge_README_autotoc_md33812}{}\doxysubsubsection{$\ast$$\ast$$<$tt$>$merge.\+multiple(...\+configuration $\vert$ \mbox{[}...\+configuration\mbox{]})$<$/tt$>$$\ast$$\ast$}\label{md_sfcode_node_modules_webpack_merge_README_autotoc_md33812}
Sometimes you may need to support multiple targets, {\itshape webpack-\/merge} will accept an object where each key represents the target configuration. The output becomes an {\itshape array} of configurations where matching keys are merged and non-\/matching keys are added.


\begin{DoxyCode}{0}
\DoxyCodeLine{var path = require('path');}
\DoxyCodeLine{var baseConfig = \{}
\DoxyCodeLine{    server: \{}
\DoxyCodeLine{      target: 'node',}
\DoxyCodeLine{      output: \{}
\DoxyCodeLine{        path: path.resolve(\_\_dirname, 'dist'),}
\DoxyCodeLine{        filename: 'lib.node.js'}
\DoxyCodeLine{      \}}
\DoxyCodeLine{    \},}
\DoxyCodeLine{    client: \{}
\DoxyCodeLine{      output: \{}
\DoxyCodeLine{        path: path.resolve(\_\_dirname, 'dist'),}
\DoxyCodeLine{        filename: 'lib.js'}
\DoxyCodeLine{      \}}
\DoxyCodeLine{    \}}
\DoxyCodeLine{  \};}
\DoxyCodeLine{}
\DoxyCodeLine{// specialized configuration}
\DoxyCodeLine{var production = \{}
\DoxyCodeLine{    client: \{}
\DoxyCodeLine{      output: \{}
\DoxyCodeLine{        path: path.resolve(\_\_dirname, 'dist'),}
\DoxyCodeLine{        filename: '[name].[hash].js'}
\DoxyCodeLine{      \}}
\DoxyCodeLine{    \}}
\DoxyCodeLine{  \}}
\DoxyCodeLine{}
\DoxyCodeLine{module.exports = merge.multiple(baseConfig, production) }

\end{DoxyCode}


\begin{quote}
Check out \href{http://survivejs.com/}{\texttt{ Survive\+JS -\/ Webpack and React}} to dig deeper into the topic. \end{quote}
\hypertarget{md_sfcode_node_modules_webpack_merge_README_autotoc_md33813}{}\doxysubsection{Development}\label{md_sfcode_node_modules_webpack_merge_README_autotoc_md33813}

\begin{DoxyEnumerate}
\item {\ttfamily npm i}
\end{DoxyEnumerate}
\begin{DoxyEnumerate}
\item {\ttfamily npm run build}
\end{DoxyEnumerate}
\begin{DoxyEnumerate}
\item {\ttfamily npm run watch}
\end{DoxyEnumerate}

Before contributing, please open an issue where to discuss.\hypertarget{md_sfcode_node_modules_webpack_merge_README_autotoc_md33814}{}\doxysubsection{License}\label{md_sfcode_node_modules_webpack_merge_README_autotoc_md33814}
{\itshape webpack-\/merge} is available under MIT. See LICENSE for more details. 