3 Star 2 Fork 0

Gitee 极速下载/pangu-js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/vinta/pangu.js
克隆/下载
webpack.config.js 1.34 KB
一键复制 编辑 原始数据 按行查看 历史
Vinta 提交于 2019-01-28 01:58 . cleanup
var _ = require('underscore');
var fs = require('fs');
var path = require('path');
var TerserPlugin = require('terser-webpack-plugin');
var webpack = require('webpack');
var packageInfo = require('./package.json');
var bannerTemplate = fs.readFileSync('src/browser/banner.txt', 'utf8');
var bannerText = _.template(bannerTemplate)(packageInfo);
var entryPath = './src/browser/pangu.js';
module.exports = {
target: 'web',
// mode: 'development',
mode: 'production',
entry: {
'pangu': entryPath,
'pangu.min': entryPath
},
output: {
path: path.resolve(__dirname, 'dist/browser/'),
filename: '[name].js',
library: 'pangu',
libraryTarget: 'umd',
umdNamedDefine: true
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules|node/,
use: {
loader: 'babel-loader',
options: {
babelrc: false,
presets: [
[
"@babel/preset-env",
{
"modules": "umd"
}
]
]
}
}
}
]
},
devtool: false,
optimization: {
minimizer: [
new TerserPlugin({
include: /\.min\.js$/
})
],
},
plugins: [
new webpack.BannerPlugin({
banner: bannerText,
raw: true,
entryOnly: true
})
]
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/pangu-js.git
git@gitee.com:mirrors/pangu-js.git
mirrors
pangu-js
pangu-js
master

搜索帮助