1
0
mirror of https://github.com/lensapp/lens.git synced 2024-11-10 18:55:52 +03:00
lens/extensions/example-extension/webpack.config.js
Jari Kolehmainen 91bef77997
Extension store base class + rename main/renderer-extensions -> extensions (#1107)
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
2020-10-21 13:55:50 +03:00

66 lines
1.3 KiB
JavaScript

const path = require('path');
module.exports = [
{
entry: './main.ts',
context: __dirname,
target: "electron-main",
mode: "production",
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
externals: [
{
"@k8slens/extensions": "var global.LensExtensions",
"mobx": "var global.Mobx",
"react": "var global.React"
}
],
resolve: {
extensions: [ '.tsx', '.ts', '.js' ],
},
output: {
libraryTarget: "commonjs2",
filename: 'main.js',
path: path.resolve(__dirname, 'dist'),
},
},
{
entry: './renderer.tsx',
context: __dirname,
target: "electron-renderer",
mode: "production",
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
externals: [
{
"@k8slens/extensions": "var global.LensExtensions",
"react": "var global.React",
"mobx": "var global.Mobx"
}
],
resolve: {
extensions: [ '.tsx', '.ts', '.js' ],
},
output: {
libraryTarget: "commonjs2",
globalObject: "this",
filename: 'renderer.js',
path: path.resolve(__dirname, 'dist'),
},
},
];