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
master
Solant 4 years ago committed by GitHub
parent 2c48df36ab
commit 817ad4209d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/app.tsx
  2. 9
      webpack.config.js

@ -1,13 +1,12 @@
import { Text, Window, hot, View } from "@nodegui/react-nodegui";
import React from "react";
import { QIcon } from "@nodegui/nodegui";
import path from "path";
import { StepOne } from "./components/stepone";
import { StepTwo } from "./components/steptwo";
import nodeguiIcon from "../assets/nodegui.jpg";
const minSize = { width: 500, height: 520 };
const winIcon = new QIcon(path.resolve(__dirname, nodeguiIcon));
const winIcon = new QIcon(nodeguiIcon);
class App extends React.Component {
render() {
return (

@ -27,8 +27,13 @@ module.exports = (env, argv) => {
}
},
{
test: /\.(png|jpe?g|gif|svg|bmp)$/i,
use: [{ loader: "file-loader" }]
test: /\.(png|jpe?g|gif|svg|bmp|otf)$/i,
use: [{
loader: "file-loader",
options: {
publicPath: "dist"
}
}]
},
{
test: /\.node/i,

Loading…
Cancel
Save