webpack-assembler
Assemble webpack configs by merging common and custom parts.
It passes through most options to the underlying webpack plugins without trying to change the paradigm too much. The result is reduced webpack config size without too much loss of control.
It includes two exports:
- merge - the default export of webpack-merge for merging configurations
- parts - a set of common parts.
Also easily brings in these dependencies:
- circular-dependency-plugin
- clean-webpack-plugin
- copy-webpack-plugin
- file-loader
- html-webpack-plugin
- url-loader
- webpack-bundle-analyzer
- webpack-merge
Related modules:
Examples
Basic
const merge parts = const ROOT_DIR = __dirnameconst SRC_DIR = exportsSRC_DIR = pathconst BUILD_DIR = exportsDIST_DIR = path var config = moduleexports = config
A bit more
var path = const merge parts = const ROOT_DIR = __dirnameconst SRC_DIR = exportsSRC_DIR = pathconst BUILD_DIR = exportsDIST_DIR = path var config = moduleexports = config
Advanced
var path = const parts assemble = const ROOT_DIR = __dirnameconst SRC_DIR = exportsSRC_DIR = pathconst BUILD_DIR = exportsDIST_DIR = path const genBase = // Env parts parts // Page hosted entry parts // Handle extracted bundles. parts // extractBundles const genDev = // Output parts // Dev server devtool: 'eval-source-map' devServer: inline: true contentBase: 'src' port: '3001' const genProd = // Output parts devtool: false moduleexports =