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:
parent
15323e3ae2
commit
58c814d7eb
@ -108,7 +108,6 @@ export default {
|
|||||||
if (!this.lens.webview) {
|
if (!this.lens.webview) {
|
||||||
console.log("create webview")
|
console.log("create webview")
|
||||||
const webview = document.createElement('webview');
|
const webview = document.createElement('webview');
|
||||||
webview.setAttribute("nodeintegration", "true");
|
|
||||||
webview.addEventListener('did-finish-load', this.lensLoaded);
|
webview.addEventListener('did-finish-load', this.lensLoaded);
|
||||||
webview.src = this.cluster.url;
|
webview.src = this.cluster.url;
|
||||||
this.lens.webview = webview;
|
this.lens.webview = webview;
|
||||||
|
|||||||
@ -15,7 +15,7 @@ export default [
|
|||||||
export function webpackConfigReact(): webpack.Configuration {
|
export function webpackConfigReact(): webpack.Configuration {
|
||||||
return {
|
return {
|
||||||
context: __dirname,
|
context: __dirname,
|
||||||
target: "electron-renderer",
|
target: "web",
|
||||||
devtool: isProduction ? "source-map" : "cheap-eval-source-map",
|
devtool: isProduction ? "source-map" : "cheap-eval-source-map",
|
||||||
mode: isProduction ? "production" : "development",
|
mode: isProduction ? "production" : "development",
|
||||||
cache: isDevelopment,
|
cache: isDevelopment,
|
||||||
@ -52,10 +52,6 @@ export function webpackConfigReact(): webpack.Configuration {
|
|||||||
|
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
|
||||||
test: /\.node$/,
|
|
||||||
use: "node-loader"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
test: /\.tsx?$/,
|
test: /\.tsx?$/,
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
@ -142,6 +138,7 @@ export function webpackConfigReact(): webpack.Configuration {
|
|||||||
export function webpackConfigVue(): webpack.Configuration {
|
export function webpackConfigVue(): webpack.Configuration {
|
||||||
const config = webpackConfigReact();
|
const config = webpackConfigReact();
|
||||||
|
|
||||||
|
config.target = "electron-renderer";
|
||||||
config.resolve.extensions.push(".vue");
|
config.resolve.extensions.push(".vue");
|
||||||
|
|
||||||
config.entry = {
|
config.entry = {
|
||||||
@ -159,6 +156,10 @@ export function webpackConfigVue(): webpack.Configuration {
|
|||||||
.filter(({ test }: { test: RegExp }) => !test.test(".css"))
|
.filter(({ test }: { test: RegExp }) => !test.test(".css"))
|
||||||
|
|
||||||
config.module.rules.push(
|
config.module.rules.push(
|
||||||
|
{
|
||||||
|
test: /\.node$/,
|
||||||
|
use: "node-loader"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
test: /\.vue$/,
|
test: /\.vue$/,
|
||||||
use: {
|
use: {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user