xms-basic-util
Version:
js基础工具类集合,集成方便后期调用,通过webpack编译,支持多种平台,如es6、node、浏览器引入等 ## 使用 ### es6方法 - 安装 ``` npm install xms-basic-util ``` - 导入 ``` import xmsBasicUtil from 'xms-basic-util' //日期转换工具对象 const dateFormat = xmsBasicUtil.dateFormat; //数字处理工具对象 const mathUtil = xmsBasicUt
36 lines (33 loc) • 786 B
JavaScript
const path = require('path');
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
module.exports = {
mode:'production',
entry: './src/index.js',
output: {
path: path.resolve(__dirname, '../dist'),
filename: 'xms-basic-util.js',
library: 'xmsBasicUtil',
libraryTarget: 'umd',
globalObject: 'this'
},
plugins: [
],
module: {
rules: [
{
test: /\.js$/,
include: [
// resolve('src'), resolve("dist")
],
use: {
loader: 'babel-loader',
options: {
presets: ['env']
}
}
}
]
}
};