[英]Transform ES6 imports into require.ensure with babel?
Is it possible with babel (or webpack or any other way) to transform all ES6 statements是否可以使用 babel(或 webpack 或任何其他方式)转换所有 ES6 语句
import X from Y;
/* file body */
into进入
require.ensure(['Y'],
function() {
/* file body */
});
Or isn't it?或者不是吗?
.babelrc
{
"plugins": ["dynamic-import-webpack"]
}
https://github.com/airbnb/babel-plugin-dynamic-import-webpack https://github.com/airbnb/babel-plugin-dynamic-import-webpack
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.