加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
webpack.config.txt 1.33 KB
一键复制 编辑 原始数据 按行查看 历史
朱平齐 提交于 2020-08-24 11:57 . 添加项目文件。
const path = require('path');
const webpack = require('webpack');
module.exports = {
target: 'web',
mode: "production",
entry: {
vcore: './src/core.ts',
main: './src/main.ts'
},
output: {
path: __dirname + '/dist',
filename: '[name].js'
},
resolve: {
extensions: ['.ts', '.tsx', '.js'],
modules: [
path.join(__dirname, "src"),
"node_modules"
]
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: "ts-loader",
options: {
transpileOnly: true
}
}
]
},
performance: {
hints: false
},
optimization: {
splitChunks: {
chunks: 'async',
minSize: 30000,
maxSize: 0,
minChunks: 1,
maxAsyncRequests: 5,
maxInitialRequests: 3,
automaticNameDelimiter: '~',
name: true,
cacheGroups: {
commons: {
name: "commons",
chunks: "initial",
minChunks: 2
}
}
}
},
plugins: [
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery'
})
]
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化