Open hlehmann opened 6 years ago
In webpack 4 we can set file types such as "javascript/esm" which have more restriction.
With type "javascript/esm" we can't use require, exports and module anymore. But there is still import, export and __webpack_module__
require
exports
module
import
export
__webpack_module__
Could it be possible to add a esm param to the babel plugin to be able to only use esm import/export
esm
// .babelrc { "plugins": [["react-hot-loader/babel",{esm:true}]] }
There is no need for a special flag, but few things had to be rethinked.
hot(__webpack_module__ || module)
In webpack 4 we can set file types such as "javascript/esm" which have more restriction.
With type "javascript/esm" we can't use
require
,exports
andmodule
anymore. But there is stillimport
,export
and__webpack_module__
Could it be possible to add a
esm
param to the babel plugin to be able to only use esm import/export