2019-05-28 23:27:25 +02:00
|
|
|
const path = require("path");
|
2019-06-23 06:11:50 +02:00
|
|
|
const CircularDependencyPlugin = require("circular-dependency-plugin");
|
2020-07-25 10:22:57 +02:00
|
|
|
const TerserPlugin = require("terser-webpack-plugin");
|
2019-05-28 23:27:25 +02:00
|
|
|
|
2019-05-29 07:00:33 +02:00
|
|
|
module.exports = {
|
|
|
|
mode: "development",
|
|
|
|
target: "node",
|
2019-06-08 08:35:43 +02:00
|
|
|
devtool: "eval-source-map",
|
2019-05-29 07:00:33 +02:00
|
|
|
entry: "./src/index.js",
|
|
|
|
output: {
|
2020-07-26 11:34:38 +02:00
|
|
|
filename: "remote.js",
|
2020-07-23 22:51:58 +02:00
|
|
|
path: path.resolve(__dirname, "dist")
|
2019-05-29 07:00:33 +02:00
|
|
|
},
|
|
|
|
externals: {
|
|
|
|
electron: `require("electron")`,
|
|
|
|
fs: `require("fs")`,
|
|
|
|
path: `require("path")`,
|
|
|
|
request: `require("request")`,
|
2020-07-16 07:42:56 +02:00
|
|
|
events: `require("events")`,
|
|
|
|
rimraf: `require("rimraf")`,
|
|
|
|
yauzl: `require("yauzl")`,
|
|
|
|
mkdirp: `require("mkdirp")`
|
2019-05-29 07:00:33 +02:00
|
|
|
},
|
|
|
|
resolve: {
|
2019-05-30 07:06:17 +02:00
|
|
|
extensions: [".js", ".jsx"],
|
2020-07-24 06:07:50 +02:00
|
|
|
alias: {
|
|
|
|
modules$: path.resolve("src", "modules"),
|
|
|
|
data$: path.resolve("src", "modules"),
|
|
|
|
builtins$: path.resolve("src", "modules")
|
|
|
|
}
|
2019-05-30 07:06:17 +02:00
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /.jsx?$/,
|
|
|
|
loader: "babel-loader",
|
|
|
|
exclude: /node_modules/,
|
|
|
|
query: {
|
|
|
|
presets: [["@babel/env", {
|
2020-07-24 06:07:50 +02:00
|
|
|
targets: {
|
|
|
|
node: "10.11.0",
|
|
|
|
chrome: "69"
|
|
|
|
}
|
|
|
|
}], "@babel/react"]
|
2019-05-30 07:06:17 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2019-06-23 06:11:50 +02:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new CircularDependencyPlugin({
|
2020-07-23 22:51:58 +02:00
|
|
|
exclude: /node_modules/,
|
2019-06-23 06:11:50 +02:00
|
|
|
cwd: process.cwd(),
|
|
|
|
})
|
2020-07-25 10:22:57 +02:00
|
|
|
],
|
|
|
|
optimization: {
|
|
|
|
minimizer: [
|
|
|
|
new TerserPlugin({
|
|
|
|
terserOptions: {
|
2020-07-26 11:34:38 +02:00
|
|
|
compress: {drop_debugger: false}
|
2020-07-25 10:22:57 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
]
|
|
|
|
}
|
2019-05-28 23:27:25 +02:00
|
|
|
};
|