Ai
2 Star 0 Fork 0

happycoding/happycode-storage

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
webpack.config.js 1.76 KB
一键复制 编辑 原始数据 按行查看 历史
南京老油条 提交于 2022-01-18 16:13 +08:00 . init
const path = require('path');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const base = {
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
devtool: 'cheap-module-source-map',
module: {
rules: [
{
include: [
path.resolve('src')
],
test: /\.js$/,
loader: 'babel-loader',
options: {
presets: [
['@babel/preset-env', {targets: {browsers: ['last 3 versions', 'Safari >= 8', 'iOS >= 8']}}]
]
}
}
]
},
optimization: {
minimizer: [
new UglifyJsPlugin({
include: /\.min\.js$/,
sourceMap: true
})
]
},
plugins: []
};
module.exports = [
// Web-compatible
Object.assign({}, base, {
target: 'web',
entry: {
'happycode-storage': './src/index.js',
'happycode-storage.min': './src/index.js'
},
output: {
library: 'HappycodeStorage',
libraryTarget: 'umd',
path: path.resolve('dist', 'web'),
filename: '[name].js'
}
}),
// Node-compatible
Object.assign({}, base, {
target: 'node',
entry: {
'happycode-storage': './src/index.js'
},
output: {
library: 'HappycodeStorage',
libraryTarget: 'commonjs2',
path: path.resolve('dist', 'node'),
filename: '[name].js'
},
externals: {
'base64-js': true,
'js-md5': true,
'localforage': true,
'text-encoding': true
}
})
];
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/happycoding-cx/happycode-storage.git
git@gitee.com:happycoding-cx/happycode-storage.git
happycoding-cx
happycode-storage
happycode-storage
master

搜索帮助