加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
webpack.config.js 1.00 KB
一键复制 编辑 原始数据 按行查看 历史
Protinam 提交于 2018-01-18 14:50 . Mostly converted
const _ = require('lodash')
const webpack = require('webpack')
const path = require('path')
const production = process.env.NODE_ENV === 'production'
let entry = {
'index': './src/index.ts'
}
if (production) {
entry = _.assign({}, entry, {'index.min': './src/index.ts'})
}
module.exports = {
entry,
output: {
path: path.resolve(__dirname, '_bundles'),
filename: '[name].js',
libraryTarget: 'commonjs',
library: 'WyvernProtocol'
},
resolve: {
extensions: ['.ts', '.js', '.json']
},
devtool: 'source-map',
plugins: [
new webpack.optimize.UglifyJsPlugin({
minimize: true,
sourceMap: true,
include: /\.min\.js$/
})
],
module: {
rules: [
{
test: /\.ts$/,
use: [
{
loader: 'awesome-typescript-loader',
query: {
declaration: false
}
}
],
exclude: /node_modules/
},
{
test: /\.json$/,
loader: 'json-loader'
}
]
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化