1 Star 0 Fork 0

猫子/ClipboardAsyncJS

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
webpack.config.js 1.33 KB
一键复制 编辑 原始数据 按行查看 历史
const pkg = require('./package.json');
const path = require('path');
const webpack = require('webpack');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const production = process.env.NODE_ENV === 'production' || false;
const banner = `clipboard.js v${pkg.version}
https://clipboardjs.com/
https://gitee.com/w3csss/clipboard-async-js
Licensed MIT © Zeno Rocha`;
module.exports = {
entry: './src/clipboard.js',
mode: 'production',
target: ['web', 'es5'],
output: {
filename: production ? 'clipboard.min.js' : 'clipboard.js',
path: path.resolve(__dirname, 'dist'),
library: 'Clipboard',
libraryExport: "default",
libraryTarget: "umd"
},
module: {
rules: [
{ test: /\.js$/, exclude: /node_modules/, use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}},
],
},
optimization: {
minimize: production,
minimizer: [
new UglifyJSPlugin({
parallel: require('os').cpus().length,
uglifyOptions: {
ie8: true,
keep_fnames: false,
output: {
beautify: false,
comments: (node, { value, type }) =>
type == 'comment2' && value.startsWith('!'),
},
},
}),
],
},
plugins: [new webpack.BannerPlugin({ banner })],
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/w3csss/clipboard-async-js.git
git@gitee.com:w3csss/clipboard-async-js.git
w3csss
clipboard-async-js
ClipboardAsyncJS
master

搜索帮助