1.0.0 • Published 3 years ago
obj_extra_functions
Licence
ISC
Version
1.0.0
Deps
0
Size
2 kB
Vulns
0
Weekly
0
webpack 打包封装js库
仅供个人学习参考使用
依赖
"webpack": "^5.75.0"
"webpack-cli": "^5.0.1"
命令
npm run build
相关配置(webpack.config.js)
const path = require('path');
module.exports = {
mode: "production",
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'ObjExtraFunctions.js',
library: {
name:'ObjExtraFunctions', // 导出的模块名
type:'umd' // 通用类型 建议
}
},
};