javascript - Use require & es6 import side by side -
is there pitfalls of using webpack's require , es6's imports in same file?
example (two imports in same file):
import view1 'mobilecomponents/view1'; //because if statement impossible in es6 imports static const view2 = require(process.env.project === 'mobile' ? 'mobilecomponents/view2' : 'desktopcomponents/view2');
i'm using es6 imports. started desktop version of project , want reuse of code. want import desktop version of code , don't want totally downgrade webpack requires.
Comments
Post a Comment