Как заменить импорт на требование

import {key as foo} from 'bar'; 
//equivalent to: var foo = require('bar').key

import {foo} from 'bar';
//equivalent to: var foo = require('bar').foo;
ofroog