FluentReader/webpack.config.js

85 lines
2.2 KiB
JavaScript
Raw Permalink Normal View History

2021-08-21 23:49:56 +02:00
const HtmlWebpackPlugin = require("html-webpack-plugin")
const HardSourceWebpackPlugin = require("hard-source-webpack-plugin")
2020-05-31 10:24:52 +02:00
module.exports = [
2021-08-21 23:49:56 +02:00
{
mode: "production",
entry: "./src/electron.ts",
target: "electron-main",
module: {
rules: [
{
test: /\.ts$/,
include: /src/,
resolve: {
extensions: [".ts", ".js"],
},
use: [{ loader: "ts-loader" }],
},
],
2020-06-15 11:25:55 +02:00
},
2021-08-21 23:49:56 +02:00
output: {
devtoolModuleFilenameTemplate: "[absolute-resource-path]",
path: __dirname + "/dist",
filename: "electron.js",
2020-06-29 13:17:33 +02:00
},
2021-12-16 08:00:48 +01:00
node: {
2021-12-16 10:26:30 +01:00
__dirname: false,
2021-12-16 08:00:48 +01:00
},
2021-08-21 23:49:56 +02:00
plugins: [new HardSourceWebpackPlugin()],
2020-06-30 13:15:37 +02:00
},
2021-08-21 23:49:56 +02:00
{
mode: "production",
entry: "./src/preload.ts",
target: "electron-preload",
module: {
rules: [
{
test: /\.ts$/,
include: /src/,
resolve: {
extensions: [".ts", ".js"],
},
use: [{ loader: "ts-loader" }],
},
],
2020-05-31 10:24:52 +02:00
},
2021-08-21 23:49:56 +02:00
output: {
path: __dirname + "/dist",
filename: "preload.js",
},
plugins: [new HardSourceWebpackPlugin()],
2020-05-31 10:24:52 +02:00
},
2021-08-21 23:49:56 +02:00
{
mode: "production",
entry: "./src/index.tsx",
target: "web",
devtool: "source-map",
performance: {
hints: false,
},
module: {
rules: [
{
test: /\.ts(x?)$/,
include: /src/,
resolve: {
extensions: [".ts", ".tsx", ".js"],
},
use: [{ loader: "ts-loader" }],
},
],
},
output: {
path: __dirname + "/dist",
filename: "index.js",
},
plugins: [
new HardSourceWebpackPlugin(),
new HtmlWebpackPlugin({
template: "./src/index.html",
}),
],
2020-05-31 10:24:52 +02:00
},
2021-08-21 23:49:56 +02:00
]