Created
September 22, 2021 09:38
-
-
Save bjszd/1d121a71e2174e848c4d9f5a2e234019 to your computer and use it in GitHub Desktop.
Example of webpack conditional import
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import aear from './ar-AE.json'; | |
import bhar from './ar-BH.json'; | |
// eslint-disable-next-line no-undef | |
const market = process.env.MARKET; | |
let polyfillData: typeof aear; | |
if (market === 'ae/ar') { | |
polyfillData = aear; | |
} | |
if (market === 'bh/ar') { | |
polyfillData = bhar; | |
} | |
export default polyfillData; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment