菜鸟初学前端,第一次尝试使用webpack,
目的是做一个lib,想用webpack + babel 自动化打包出来 es5 的js代码
模块中用到了Class,直接export{className}出来,
结果是导入的地方不能实例化,
原来是需要这样写:
export default MyClass;
引入的时候:
import MyClass from "./myclass.js";
作者:码路工人
公众号:码路工人有力量(Code-Power)
欢迎关注个人微信公众号 Coder-Power
一起学习提高吧~