@tianqing123
2017-04-25T17:09:59.000000Z
字数 519
阅读 825
未分类
// webpack配置
module.exports = {
entry:'./index.js',
output: {
path: __dirname,
filename: "dist/tsdriver.js",
libraryTarget: "var"
}
};
// 不同环境的js适配
(function(root, factory) {
if (typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if (typeof define === 'function' && define.amd)
define([], factory);
else if (typeof exports === 'object')
exports["Tianshan"] = factory();
else
root["Tianshan"] = factory();
})(this, function(){
return (function(modules){})([]);
});
参考
webpack配置说明