mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
treat react as web app
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
1 parent
15323e3ae2
commit
58c814d7eb
2 files changed
+6
-6
No files matched your search
@@ -108,7 +108,6 @@ export default {
|
||||
if (!this.lens.webview) {
|
||||
console.log("create webview")
|
||||
const webview = document.createElement('webview');
|
||||
webview.setAttribute("nodeintegration", "true");
|
||||
webview.addEventListener('did-finish-load', this.lensLoaded);
|
||||
webview.src = this.cluster.url;
|
||||
this.lens.webview = webview;
|
||||
|
||||
+6
-5
@@ -15,7 +15,7 @@ export default [
|
||||
export function webpackConfigReact(): webpack.Configuration {
|
||||
return {
|
||||
context: __dirname,
|
||||
target: "electron-renderer",
|
||||
target: "web",
|
||||
devtool: isProduction ? "source-map" : "cheap-eval-source-map",
|
||||
mode: isProduction ? "production" : "development",
|
||||
cache: isDevelopment,
|
||||
@@ -52,10 +52,6 @@ export function webpackConfigReact(): webpack.Configuration {
|
||||
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.node$/,
|
||||
use: "node-loader"
|
||||
},
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
exclude: /node_modules/,
|
||||
@@ -142,6 +138,7 @@ export function webpackConfigReact(): webpack.Configuration {
|
||||
export function webpackConfigVue(): webpack.Configuration {
|
||||
const config = webpackConfigReact();
|
||||
|
||||
config.target = "electron-renderer";
|
||||
config.resolve.extensions.push(".vue");
|
||||
|
||||
config.entry = {
|
||||
@@ -159,6 +156,10 @@ export function webpackConfigVue(): webpack.Configuration {
|
||||
.filter(({ test }: { test: RegExp }) => !test.test(".css"))
|
||||
|
||||
config.module.rules.push(
|
||||
{
|
||||
test: /\.node$/,
|
||||
use: "node-loader"
|
||||
},
|
||||
{
|
||||
test: /\.vue$/,
|
||||
use: {
|
||||
|
||||
Reference in new issue
Block a user