2020-03-16 05:58:00 +03:00
|
|
|
const Copy = require('copy-webpack-plugin')
|
|
|
|
const path = require('path')
|
|
|
|
|
|
|
|
const thisPath = path.resolve(__dirname)
|
2021-11-05 14:51:43 +03:00
|
|
|
const root = path.resolve(thisPath, '..', '..', '..', '..')
|
|
|
|
const distPath = path.resolve(root, 'dist')
|
2020-03-16 05:58:00 +03:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: {
|
2021-11-05 14:51:43 +03:00
|
|
|
index: path.resolve(thisPath, 'src', 'index.js'),
|
2020-03-16 05:58:00 +03:00
|
|
|
},
|
|
|
|
mode: 'production',
|
2021-11-05 14:51:43 +03:00
|
|
|
target: 'electron-main',
|
2020-03-16 05:58:00 +03:00
|
|
|
output: {
|
2021-11-05 14:51:43 +03:00
|
|
|
path: path.resolve(distPath, 'content'),
|
2020-03-16 05:58:00 +03:00
|
|
|
filename: '[name].js',
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new Copy([
|
|
|
|
{
|
2021-11-05 14:51:43 +03:00
|
|
|
from: path.resolve(thisPath, 'package.json'),
|
|
|
|
to: path.resolve(distPath, 'content', 'package.json'),
|
2020-03-16 05:58:00 +03:00
|
|
|
},
|
|
|
|
{
|
2021-11-05 14:51:43 +03:00
|
|
|
from: path.resolve(thisPath, 'src', 'preload.js'),
|
|
|
|
to: path.resolve(distPath, 'content', 'preload.js'),
|
|
|
|
},
|
2020-03-16 05:58:00 +03:00
|
|
|
]),
|
|
|
|
],
|
|
|
|
performance: {
|
|
|
|
hints: false,
|
|
|
|
},
|
|
|
|
stats: 'minimal',
|
|
|
|
}
|