Electron-react-boilerplate: Use custome font

Created on 1 Apr 2018  路  3Comments  路  Source: electron-react-boilerplate/electron-react-boilerplate

I want use custom font in my app. in dev mode, everything ok, but when i package it, not any font detected.
i use this suggestion for remove extra ./dist/, but not help!

Most helpful comment

Can you let me know where your fonts are situated in your project?

Here's what works for me:

  const rootPath = process.cwd();
  output: {
    path: path.join(rootPath, 'app/dist'),
    publicPath: '../dist/',
    filename: 'renderer.prod.js'
  },

Important to note, in my setup I have the following file structure.

projectRoot\webpack_configs -- Config files
projectRoot\app -- Application files root
projectRoot\app\scss\fonts -- Fonts

I don't recall if these settings in particular were changed to accommodate my nested webpack config folder.

You can extract your application's app.asar via the following terminal command. Run this in the folder where your app.asar is to unpack it to a folder called unpackedAsar

asar extract app.asar unpackedAsar

This should help with debugging. Happy to help further if I can. There's certainly a steep learning curve.

All 3 comments

Can you let me know where your fonts are situated in your project?

Here's what works for me:

  const rootPath = process.cwd();
  output: {
    path: path.join(rootPath, 'app/dist'),
    publicPath: '../dist/',
    filename: 'renderer.prod.js'
  },

Important to note, in my setup I have the following file structure.

projectRoot\webpack_configs -- Config files
projectRoot\app -- Application files root
projectRoot\app\scss\fonts -- Fonts

I don't recall if these settings in particular were changed to accommodate my nested webpack config folder.

You can extract your application's app.asar via the following terminal command. Run this in the folder where your app.asar is to unpack it to a folder called unpackedAsar

asar extract app.asar unpackedAsar

This should help with debugging. Happy to help further if I can. There's certainly a steep learning curve.

Solved! '../dist/' instead of './dist' solve my problem. Thnx Slapbox.

Happy to help! If this is all wrapped up, feel free to close this issue at your convenience.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anubra266 picture anubra266  路  3Comments

chie4hao picture chie4hao  路  3Comments

helpceo picture helpceo  路  3Comments

aguynamedben picture aguynamedben  路  3Comments

davej picture davej  路  4Comments