How to use the webpack-merge.multiple function in webpack-merge

To help you get started, we’ve selected a few webpack-merge examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cozy / create-cozy-app / packages / cozy-scripts / scripts / config.js View on Github external
const options = Object.assign({}, configPart.__mergeStrategy)
        delete configPart.__mergeStrategy
        separateConfig = mergeWithOptions(options, [mergedConfig], configPart)
      } else {
        separateConfig = merge(mergedConfig, configPart)
      }
      if (separateConfig.multiple) delete separateConfig.multiple
      configs.push(isDebugMode ? smp.wrap(separateConfig) : separateConfig)
    }
    delete mergedConfig.multiple
  }

  // replace the first position placeholder in the list
  configs[0] = isDebugMode ? smp.wrap(mergedConfig) : mergedConfig

  return merge.multiple(configs)
}
github digaverse / webxr-webpack-boilerplate / devel / webpack.dev.js View on Github external
const cli = require('./utils/cli')

// define your stuff

const baseDir = path.join(__dirname, '../')
const buildDir = path.join(baseDir, 'build')
// const apiDir = path.join(process.cwd(), 'build', 'api')
const sslKey = path.join(__dirname, 'ssl', 'localhost.key')
const sslCrt = path.join(__dirname, 'ssl', 'localhost.crt')

const defaultPort = 9000

// define your stuff
const PLUGINS = []

const configs = merge.multiple(common, {
  app: {
    mode: 'development',
    devtool: 'inline-source-map',
    plugins: PLUGINS,
  },
  staticAssets: {},
  vendors: {},
  pwa: {},
})


/* eslint no-sync: ["error", { allowAtRootLevel: true }]*/
serve({}, {
  compiler: webpack(configs),
  content: buildDir,
  clipboard: true,
github buttplugio / buttplug-js / packages / buttplug / build / webpack.production.js View on Github external
'use strict';
const merge = require('webpack-merge');
const common = require('./webpack.base.js');
const webpack = require('webpack');
const TerserPlugin = require('terser-webpack-plugin');

module.exports = merge.multiple(common, [
  {
    mode: "none",
    output: {
      filename: `buttplug.min.js`
    },
    optimization: {
      minimize: false
    },
    devtool: '#source-map',
    plugins: [
      new TerserPlugin({
        sourceMap: true,
        parallel: true,
        terserOptions: {
          mangle: {
            keep_classnames: true,
github embark-framework / subspace / webpack.dev.js View on Github external
const merge = require("webpack-merge");
const common = require("./webpack.common.js");

const mode_config = {};
Object.keys(common).forEach(k => {
  mode_config[k] = {
    mode: "development"
  }
});

module.exports = merge.multiple(common, mode_config);
github buttplugio / buttplug-js / packages / buttplug / build / webpack.analyzer.js View on Github external
'use strict';
const merge = require('webpack-merge');
const production = require('./webpack.production.js');
const webpack = require('webpack');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

module.exports = {
  plugins: [
    new BundleAnalyzerPlugin()
  ]
};

module.exports = merge.multiple(production, [
  {
    plugins: [
      new BundleAnalyzerPlugin()
    ]
  }]);
github embark-framework / subspace / webpack.prod.js View on Github external
const merge = require("webpack-merge");
const common = require("./webpack.common.js");

const mode_config = {};
Object.keys(common).forEach(k => {
  mode_config[k] = {
    mode: "production"
  }
});

module.exports = merge.multiple(common, mode_config);