Skip to content

webpack.config.js could not resolve webpackMerge #27

Description

@iRenuSingh

I followed steps from article to run bolierplate code but faced below issue in webpack.config.js file due to version issue

cross-env NODE_ENV=development webpack-dev-server --open
reactapp/webpack.config.js:14
module.exports = webpackMerge(common, envConfig);
^

TypeError: webpackMerge is not a function

Solution to it I found :

webpack.config.js
require('@babel/register');
const {merge} = require('webpack-merge');

const common = require('./config/webpack/webpack.common.babel');

const envs = {
development: 'dev',
production: 'prod'
};

/* eslint-disable global-require,import/no-dynamic-require */
const env = envs[process.env.NODE_ENV || 'development'];
const envConfig = require(./config/webpack/webpack.${env}.babel);
module.exports = merge(common, envConfig);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions