babel-plugin-import-glob
babel-plugin-import-glob copied to clipboard
How to import inside a function?
I need to convert the following into the appropriate syntax
if (module && module.hot)
module.hot.accept('./reducers', () =>
store.replaceReducer(nextRootReducer = require('./reducers').default)
);
nothing i've tried has worked so far
This plugin only works with import
statements, and those must be top-level. Perhaps support for import()
could be added?
Hmm I'll take a read of https://github.com/tc39/proposal-dynamic-import/blob/master/README.md
To better understand how important function works