2022-07-09 10:37:19 +02:00
|
|
|
const path = require("path");
|
2022-11-01 08:07:25 +01:00
|
|
|
const CopyPlugin = require("copy-webpack-plugin");
|
2022-07-09 10:37:19 +02:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
mode: "development",
|
|
|
|
entry: {
|
|
|
|
emain: ["./src/emain.ts"],
|
|
|
|
},
|
|
|
|
target: "electron-main",
|
|
|
|
output: {
|
|
|
|
path: path.resolve(__dirname, "dist"),
|
|
|
|
filename: "[name]-dev.js"
|
|
|
|
},
|
|
|
|
externals: {
|
|
|
|
"fs": "require('fs')",
|
|
|
|
"fs-ext": "require('fs-ext')",
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.tsx?$/,
|
|
|
|
// exclude: /node_modules/,
|
|
|
|
use: {
|
|
|
|
loader: "babel-loader",
|
|
|
|
options: {
|
|
|
|
presets: [
|
|
|
|
[
|
|
|
|
"@babel/preset-env",
|
|
|
|
{
|
|
|
|
targets: "defaults and not ie > 0 and not op_mini all and not op_mob > 0 and not kaios > 0 and not and_qq > 0 and not and_uc > 0 and not baidu > 0",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
"@babel/preset-react",
|
|
|
|
"@babel/preset-typescript"],
|
|
|
|
plugins: [
|
|
|
|
["@babel/transform-runtime", {"regenerator": true}],
|
|
|
|
"@babel/plugin-transform-react-jsx",
|
|
|
|
["@babel/plugin-proposal-decorators", { "legacy": true }],
|
|
|
|
["@babel/plugin-proposal-class-properties", { "loose": true }],
|
|
|
|
["@babel/plugin-proposal-private-methods", { "loose": true }],
|
|
|
|
["@babel/plugin-proposal-private-property-in-object", { "loose": true }],
|
|
|
|
"babel-plugin-jsx-control-statements",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
},
|
2022-11-01 08:07:25 +01:00
|
|
|
plugins: [
|
|
|
|
new CopyPlugin({
|
|
|
|
patterns: [{from: "src/preload.js", to: "preload.js"}],
|
|
|
|
}),
|
|
|
|
],
|
2022-07-09 10:37:19 +02:00
|
|
|
resolve: {
|
|
|
|
extensions: ['.ts', '.tsx', '.js']
|
|
|
|
},
|
|
|
|
}
|