Skip to content

Commit 817ad42

Browse files
authored
File loader improvements (#82)
* Added otf fonts to file-loader * Fixed assets import with file-loader * replace path.resolve with simple import and file-loader
1 parent 2c48df3 commit 817ad42

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Diff for: src/app.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import { Text, Window, hot, View } from "@nodegui/react-nodegui";
22
import React from "react";
33
import { QIcon } from "@nodegui/nodegui";
4-
import path from "path";
54
import { StepOne } from "./components/stepone";
65
import { StepTwo } from "./components/steptwo";
76
import nodeguiIcon from "../assets/nodegui.jpg";
87

98
const minSize = { width: 500, height: 520 };
10-
const winIcon = new QIcon(path.resolve(__dirname, nodeguiIcon));
9+
const winIcon = new QIcon(nodeguiIcon);
1110
class App extends React.Component {
1211
render() {
1312
return (

Diff for: webpack.config.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,13 @@ module.exports = (env, argv) => {
2727
}
2828
},
2929
{
30-
test: /\.(png|jpe?g|gif|svg|bmp)$/i,
31-
use: [{ loader: "file-loader" }]
30+
test: /\.(png|jpe?g|gif|svg|bmp|otf)$/i,
31+
use: [{
32+
loader: "file-loader",
33+
options: {
34+
publicPath: "dist"
35+
}
36+
}]
3237
},
3338
{
3439
test: /\.node/i,

0 commit comments

Comments
 (0)