babel-plugin-import-glob icon indicating copy to clipboard operation
babel-plugin-import-glob copied to clipboard

How to import inside a function?

Open noahehall opened this issue 6 years ago • 2 comments

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

noahehall avatar Nov 18 '17 03:11 noahehall

This plugin only works with import statements, and those must be top-level. Perhaps support for import() could be added?

novemberborn avatar Nov 18 '17 10:11 novemberborn

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

noahehall avatar Nov 18 '17 12:11 noahehall