Files
Melo/build-config/main/webpack.config.prod.js
T
lyswhut d2f5485996
Build / Windows (push) Waiting to run
Build / Windows_7 (push) Waiting to run
Build / Mac (push) Waiting to run
Build / Linux (push) Waiting to run
新增 Windows 旧版提示功能,提醒用户升级至新版系统以提高安全性和性能
2026-09-19 00:50:49 +08:00

52 lines
1.4 KiB
JavaScript

const path = require('path')
const { merge } = require('webpack-merge')
const webpack = require('webpack')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const baseConfig = require('./webpack.config.base')
// const { dependencies } = require('../../package.json')
// const buildConfig = require('../webpack-build-config')
module.exports = merge(baseConfig, {
mode: 'production',
devtool: false,
entry: {
main: path.join(__dirname, '../../src/main/index.ts'),
// 'dbService.worker': path.join(__dirname, '../../src/main/worker/dbService/index.ts'),
},
node: {
__dirname: false,
__filename: false,
},
plugins: [
new CopyWebpackPlugin({
patterns: [
{
from: path.join(__dirname, '../../src/main/modules/userApi/renderer/user-api.html'),
to: path.join(__dirname, '../../dist/userApi/renderer/user-api.html'),
},
{
from: path.join(__dirname, '../../src/common/theme/images/*').replace(/\\/g, '/'),
to: path.join(__dirname, '../../dist/theme_images/[name][ext]'),
},
],
}),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"',
BUILD_WIN7: `'${process.env.BUILD_WIN7}'`,
},
}),
],
performance: {
maxEntrypointSize: 1024 * 1024 * 10,
maxAssetSize: 1024 * 1024 * 20,
},
optimization: {
minimize: false,
},
})