lx-music-desktop/build-config/main/webpack.config.prod.js

51 lines
1.2 KiB
JavaScript
Raw Normal View History

2019-08-16 09:27:23 +00:00
const path = require('path')
2020-07-07 18:01:46 +00:00
const { merge } = require('webpack-merge')
2019-08-16 09:27:23 +00:00
const webpack = require('webpack')
2021-03-07 04:01:59 +00:00
const CopyWebpackPlugin = require('copy-webpack-plugin')
2019-08-16 09:27:23 +00:00
const baseConfig = require('./webpack.config.base')
const { dependencies } = require('../../package.json')
module.exports = merge(baseConfig, {
mode: 'production',
entry: {
main: path.join(__dirname, '../../src/main/index.js'),
},
externals: [
...Object.keys(dependencies || {}),
2021-08-29 10:27:01 +00:00
// 'font-list',
2019-08-16 09:27:23 +00:00
],
node: {
__dirname: false,
__filename: false,
},
plugins: [
2021-03-07 04:01:59 +00:00
new CopyWebpackPlugin({
patterns: [
{
from: path.join(__dirname, '../../src/main/modules/userApi/renderer'),
2022-05-11 07:37:06 +00:00
to: path.join(__dirname, '../../dist/userApi/renderer'),
2021-03-07 04:01:59 +00:00
},
{
from: path.join(__dirname, '../../src/main/modules/userApi/rendererEvent/name.js'),
2022-05-11 07:37:06 +00:00
to: path.join(__dirname, '../../dist/userApi/rendererEvent/name.js'),
2021-03-07 04:01:59 +00:00
},
],
}),
2019-08-16 09:27:23 +00:00
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"',
},
}),
],
2022-05-21 17:50:34 +00:00
performance: {
maxEntrypointSize: 1024 * 1024 * 10,
maxAssetSize: 1024 * 1024 * 20,
},
2022-01-07 01:42:02 +00:00
optimization: {
minimize: false,
},
2019-08-16 09:27:23 +00:00
})