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.
5
Answers
In a new version of webpack-merge, It is imported like below.
I use a ES6 webpack config, so I use [email protected] …
As from version 5 of webpack-merge, the merge function is now named export instead of a default export.
Before version 5
From version 5
If you are using ES modules, then you should do as:
you can also leverage merge by renaming it like below:
by this way you still using the same name of old api of the package!
I have imported like below,
and used as