在webpack的配置文件里配置輸出模式output.libraryTarget配置為commonjs2即為common2的標(biāo)準(zhǔn),可以被其他模塊import或者配置為umd為全兼容模式