Suppose you want override import/require path, such as:
import config from '../../config.market.json'
const config = require('../../config.market.json')
to:
import config from '../../config.other_market.json'
const config = require('../../config.other_market.json')
You can add plugin in to webpack config:
plugins: [
new WebpackPathOverridePlugin(/config\.market\.json$/, 'config\.other_market\.json'),
],
The first param is the path(it can be a regex) that you want to be override.
The second param is the path that be used to override the first param.