Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

145
Views
webpack-merge merge is not a function

I have trying to add react in the shopify theme. So configured react, webpack, babel manually. Webpack.dev.js

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

module.exports = merge(common, {
  mode: "development",
  devtool: "inline-source-map",
  watch: true
})

But I am getting error, merge is not a function. Thanks in advance.

over 4 years ago · Santiago Trujillo
4 answers
Answer question

0

In a new version of webpack-merge, It is imported like below.

const { merge } = require('webpack-merge');
over 4 years ago · Santiago Trujillo Report

0

I use a ES6 webpack config, so I use webpack-merge@4.2.1 ...

import merge from "webpack-merge"
over 4 years ago · Santiago Trujillo Report

0

As from version 5 of webpack-merge, the merge function is now named export instead of a default export.

Before version 5

const merge = require('webpack-merge');

From version 5

const merge = require('webpack-merge').merge;
// or       
const { merge } = require('webpack-merge');

If you are using ES modules, then you should do as:

import { merge } from "webpack-merge"
over 4 years ago · Santiago Trujillo Report

0

you can also leverage merge by renaming it like below:

const { merge: webpackMerge } = require("webpack-merge");

by this way you still using the same name of old api of the package!

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!