expose ES6 modules
gunnim opened this issue · comments
When exposing an es6 module i get a global object with a property named default which represents the export.
I would like to be able to skip this wrapper and have the global variable = default export. no abstraction/wrapper.
As it stands I find myself creating intermediate modules with the following syntax
module.exports = require('./filename').default;
and then
require('expose-loader?LibraryName!./intermediateFile');
Is there a simple solution to this problem?
If not, are there any plans for a fix?
Deduced the following after inspecting the webpack bundle
global["LibraryName"] = require('./fileName').default;
Is this syntax safe to use with webpack or is this subject to change?
Not in the near future, but no guarantees either
Alright, thanks for the quick support :)