question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extra ./dist on asset files in prod

See original GitHub issue

Hopefully this will help someone. Or maybe someone can tell what I was doing wrong to begin with. I have custom font files that were loading fine in dev. In prod, however, styles.css was looking for the font files in:

dist/dist/fontfilename.woff

Changing this line:

https://github.com/chentsulin/electron-react-boilerplate/blob/master/webpack.config.renderer.prod.js#L25

to

'publicPath: '',

fixed the problem.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:7

github_iconTop GitHub Comments

11reactions
W1M0Rcommented, Jan 30, 2019

I get the same issue in production if I make use of an app.global.scss (SASS) file, but not when I use an app.global.css file.

webpack.config.renderer.prod.babel.js has the following loader configuration for the global.css rule:

...
// rule extract for test: /\.global\.css$/,
{
 loader: MiniCssExtractPlugin.loader,
 options: {
   publicPath: './'
 }
},
...

But for the global.scss rule it is:

...
// rule extract for test: /\.global\.(scss|sass)$/,
{
 loader: MiniCssExtractPlugin.loader,
},
...

In other words, the global SASS rule is missing the publicPath option. After adding the same publicPath option to the global.scss rule, the issue was resolved for me.

1reaction
toioskicommented, Nov 27, 2020

@W1M0R you saved my day, thanks a lot!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Copy content of assets folder to target dist · Issue #320 - GitHub
Files unknown for typescript compiler, assets file should be copied during build. My custom middleware is processing files, which are not ...
Read more >
How to include custom files with angular-cli build?
How do I tell angular-cli to include a file from "src/assets" in the root of "dist" when it builds? We deploy to a...
Read more >
Angular CLI: Different ways to include assets - Łukasz Nojek
Just add files to the assets folder and refer to them using ... the asset will go to app/component1/assets folder in the dist...
Read more >
What is an Asset Directory? - Asset Directories & File Storage
Sometimes, a file is just a file, and ProGet asset directories ... Files and Sub-folders can have additional metadata stored in ProGet.
Read more >
Static Asset Handling - Vite
Referenced assets are included as part of the build assets graph, will get hashed file names, and can be processed by plugins for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found