As far as I understand it, if I create an ES6 module, I can only import it from code that is itself a module. This means non-module code, i.e. inline Javascript, or the Chrome dev tools console can never access code that is in a module.
Is that true? Is there any way around this because it seems like a fairly extreme limitation.
You can use dynamic import within Chrome's console.
import('path/to/module.js').then(m => module = m) // [doSomething] is an exported function from [module.js]. module.doSomething()
1.4m articles
1.4m replys
5 comments
57.0k users