From 4f946abfb302efc380289a148c336650965fb575 Mon Sep 17 00:00:00 2001 From: Atul R Date: Thu, 22 Aug 2019 23:41:20 +0200 Subject: [PATCH] fixes image url --- src/index.tsx | 4 +++- webpack.config.js | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/index.tsx b/src/index.tsx index 658f520..6427d2b 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -7,10 +7,12 @@ import { Image, useEventHandler } from "@nodegui/react-nodegui"; +import path from "path"; import React, { useState } from "react"; import { AspectRatioMode, QPushButtonEvents } from "@nodegui/nodegui"; import imageUrl from "../assets/sample.jpg"; +const distImgUrl = path.resolve(__dirname, imageUrl); const fixedSize = { width: 500, height: 500 }; const App = () => { @@ -27,7 +29,7 @@ const App = () => { {`Time in epoc: ${time.getTime()}`} diff --git a/webpack.config.js b/webpack.config.js index a97260a..02a55e9 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -8,6 +8,9 @@ module.exports = { path: path.resolve(__dirname, "dist"), filename: "index.js" }, + node: { + __dirname: false + }, module: { rules: [ {