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

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

Loading…
Cancel
Save