mirror of
https://github.com/excalidraw/excalidraw-desktop.git
synced 2026-05-17 13:30:38 +00:00
6138f9587f
* add basic electron unit test for mac and linux Co-authored-by: Shriram Balaji <shrirambalaji1996@gmail.com>
61 lines
1.2 KiB
JavaScript
61 lines
1.2 KiB
JavaScript
const path = require("path");
|
|
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
|
|
const commonConfiguration = {
|
|
mode: "development",
|
|
devtool: "sourcemap",
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.ts$/,
|
|
include: /src/,
|
|
use: [{loader: "ts-loader"}],
|
|
},
|
|
],
|
|
},
|
|
resolve: {
|
|
extensions: [".ts", ".js", ".json"],
|
|
},
|
|
};
|
|
|
|
module.exports = [
|
|
{
|
|
...commonConfiguration,
|
|
target: "electron-main",
|
|
entry: "./src/main.ts",
|
|
output: {
|
|
path: path.resolve(__dirname, "dist"),
|
|
filename: "main.js",
|
|
},
|
|
node: {
|
|
__dirname: false,
|
|
},
|
|
},
|
|
{
|
|
...commonConfiguration,
|
|
target: "electron-renderer",
|
|
entry: "./src/preload.ts",
|
|
node: {__dirname: false, global: true},
|
|
output: {
|
|
path: path.resolve(__dirname, "dist"),
|
|
filename: "preload.js",
|
|
},
|
|
},
|
|
{
|
|
...commonConfiguration,
|
|
target: "electron-renderer",
|
|
entry: "./src/renderer.ts",
|
|
output: {
|
|
path: path.resolve(__dirname, "dist"),
|
|
filename: "renderer.js",
|
|
},
|
|
|
|
plugins: [
|
|
new HtmlWebpackPlugin({
|
|
filename: "pages/about.html",
|
|
template: "./src/pages/about.html",
|
|
}),
|
|
],
|
|
},
|
|
];
|