1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/webpack.main.ts
2020-06-16 12:44:03 +03:00

50 lines
1.1 KiB
TypeScript
Executable File

import path from "path";
import webpack from "webpack";
import ForkTsCheckerPlugin from "fork-ts-checker-webpack-plugin"
import { isDevelopment, isProduction, mainDir, outDir } from "./src/common/vars";
export default function (): webpack.Configuration {
return {
context: __dirname,
target: "electron-main",
mode: isProduction ? "production" : "development",
cache: isDevelopment,
entry: {
main: path.resolve(mainDir, "index.ts"),
},
output: {
path: outDir,
},
resolve: {
extensions: ['.json', '.js', '.ts']
},
externals: [
"@kubernetes/client-node",
"handlebars",
"node-pty",
"ws",
],
module: {
rules: [
{
test: /\.node$/,
use: "node-loader"
},
{
test: /\.ts$/,
exclude: /node_modules/,
use: {
loader: "ts-loader",
options: {
transpileOnly: true,
}
},
},
]
},
plugins: [
new ForkTsCheckerPlugin(),
]
}
}