How to use the webpack-merge.merge 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 AdguardTeam / AdGuardHome / client2 / scripts / webpack / webpack.config.dev.js View on Github external
const proxy = require('http-proxy-middleware');
const Webpack = require('webpack');

const { getDevServerConfig } = require('./helpers');
const baseConfig = require('./webpack.config.base');

const devHost = process.env.DEV_HOST
const target = getDevServerConfig();

const options = {
    target: devHost || `http://${target.host}:${target.port}`, // target host
    changeOrigin: true, // needed for virtual hosted sites
};
const apiProxy = proxy.createProxyMiddleware(options);

module.exports = merge(baseConfig, {
    mode: 'development',
    output: {
        path: path.resolve(__dirname, '../../build2'),
        filename: '[name].bundle.js',
    },
    optimization: {
        noEmitOnErrors: true,
    },
    devServer: {
        port: 4000,
        historyApiFallback: true,
        before: (app) => {
            app.use('/control', apiProxy);
            app.use(history({
                rewrites: [
                    {
github replicatedhq / kots / kotsadm / web / webpack.config.js View on Github external
new webpack.ContextReplacementPlugin(/graphql-language-service-interface[\/\\]dist/, /\.js$/),
      new MiniCssExtractPlugin({
        filename: "style.[hash].css",
        chunkFilename: "[id].css"
      })
      // new BundleAnalyzerPlugin({
      //   generateStatsFile: true,
      //   analyzerHost: "0.0.0.0",
      //   analyzerPort: 30088
      // })
    ],
  };

  if (env === "skaffold" || !env) {
    var dev = require("./webpack.config.dev");
    return merge(common, dev);
  } else {
    var dist = require("./webpack.config.dist");
    return merge(common, dist(env));
  }
};
github MissouriMRDT / BaseStation_Software / Electron / internals / configs / webpack.config.renderer.dev.babel.js View on Github external
'webpack.config.renderer.dev.dll'
)

/**
 * Warn if the DLL is not built
 */
if (!requiredByDLLConfig && !(fs.existsSync(dll) && fs.existsSync(manifest))) {
  console.log(
    chalk.black.bgYellow.bold(
      'The DLL files are missing. Sit back while we build them for you with "yarn build-dll"'
    )
  )
  execSync('yarn build-dll')
}

export default merge(baseConfig, {
  devtool: 'inline-source-map',

  mode: 'development',

  target: 'electron-renderer',

  entry: [
    'core-js',
    'regenerator-runtime/runtime',
    ...(process.env.PLAIN_HMR ? [] : ['react-hot-loader/patch']),
    `webpack-dev-server/client?http://localhost:${port}/`,
    'webpack/hot/only-dev-server',
    require.resolve('../../RED/RED.tsx'),
  ],

  output: {
github cerner / kaiju / webpack.config.js View on Github external
const mergedConfig = (env, argv) => (
  merge(terraWebpackConfig(env, argv), appWebpackConfig(env, argv))
);
github SFDO-Tooling / MetaCI / webpack.prod.js View on Github external

'use strict';

process.env.NODE_ENV = 'production';

const path = require('path');

const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const { merge } = require('webpack-merge');
const webpack = require('webpack');

const common = require('./webpack.common.js');

module.exports = merge(common, {
  mode: 'production',
  output: {
    filename: '[name].[chunkhash].min.js',
    path: path.join(__dirname, 'dist', 'prod'),
  },
  devtool: 'source-map',
  plugins: [
    new CleanWebpackPlugin(),
    new OptimizeCSSAssetsPlugin(),
    new MiniCssExtractPlugin({
      filename: '[name].[chunkhash].min.css',
    }),
    new webpack.DefinePlugin({
      'process.env.NODE_ENV': JSON.stringify('production'),
    }),
    new webpack.HashedModuleIdsPlugin(),
github 3liz / lizmap-web-client / assets / webpack.dev.js View on Github external
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');

module.exports = merge(common, {
    mode: 'development',
    devtool: 'eval-source-map'
});
github WangYihang / Platypus / html / ttyd / webpack.config.js View on Github external
}),
            new OptimizeCSSAssetsPlugin({
                cssProcessorOptions: {
                    map: {
                        inline: false,
                        annotation: true
                    }
                }
            }),
        ]
    },
    devtool: 'source-map',
};


module.exports = merge(baseConfig, devMode ? devConfig : prodConfig);
github pyroscope-io / pyroscope / scripts / webpack / webpack.prod.js View on Github external
const { DefinePlugin } = require('webpack');
const { merge } = require('webpack-merge');

const common = require('./webpack.common.js');

module.exports = merge(common, {
  mode: 'production'
});
github pipe-cd / pipe / pkg / app / web / webpack.config.js View on Github external
module.exports = (env) => {
  return merge(commonConfig(env), {
    resolve: {
      extensions: [".mjs", ".js", ".jsx"],
      alias: {
        pipe: path.resolve(env.bazelBinPath),
      },
    },
    module: {
      rules: [
        {
          type: "javascript/auto",
          test: /\.m?js$/,
          resolve: { fullySpecified: false },
          use: [],
        },
      ],
    },
github mayuki / Rin / src / Rin.Frontend / webpack.prod.config.js View on Github external
const TerserWebpackPlugin = require("terser-webpack-plugin");
const webpackMerge = require('webpack-merge');
const configBase = require('./webpack.config.js');

module.exports = webpackMerge.merge(configBase, {
    output: {
        publicPath: './',
    },
    mode: 'production',
    devtool: false,

    optimization: {
        minimizer: [
            new TerserWebpackPlugin()
        ]
    },
});