1 Star 0 Fork 2

张知己/zh-address-parse

forked from Fourteen/zh-address-parse 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
webpack.config.build.lib.js 1.32 KB
一键复制 编辑 原始数据 按行查看 历史
三咲智子 提交于 2020-12-30 17:52 . chore: update dependencies
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const dirApp = path.join(__dirname, 'app');
/**
* Webpack Configuration
*/
module.exports = {
entry: path.join(dirApp, 'lib/address-parse.js'),
output: {
filename: 'zh-address-parse.min.js', //打包之后生成的文件名,可以随意写。
library: 'ZhAddressParse', // 指定类库名,主要用于直接引用的方式(比如使用script 标签)
libraryExport: "default", // 对外暴露default属性,就可以直接调用default里的属性
globalObject: 'this', // 定义全局变量,兼容node和浏览器运行,避免出现"window is not defined"的情况
libraryTarget: 'umd' // 定义打包方式Universal Module Definition,同时支持在CommonJS、AMD和全局变量使用
},
mode: "production",
module: {
rules: [
// BABEL
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /(node_modules)/,
options: {
compact: true
}
},
]
},
plugins: [
new HtmlWebpackPlugin({
template: path.join(__dirname, 'index.html'),
title: 'zh-address-parse'
})
],
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/y21179/zh-address-parse.git
git@gitee.com:y21179/zh-address-parse.git
y21179
zh-address-parse
zh-address-parse
master

搜索帮助