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.

Malformed filepaths and output options ignored in 'light' mode

See original GitHub issue

When in light mode (i.e. development), the publicPath or outputPath options are ignored if set and the file output is double-nested.

Steps to reproduce

  • Set WebpackConfig.mode / NODE_ENV to ‘development’, or change the FaviconsPlugin.mode to ‘light’
  • Set Webpack’s output.publicPath value to somedir/foo
  • Set Plugin’s publicPath value to somedir/bar as per the README.
  • Build the project
  • Observe the generated file path

Expected Setting a FaviconsPlugin.publicPath value of somedir/bar will generate somedir/bar/<favicon> as the output file.

Actual Setting a FaviconsPlugin.publicPath value of somedir/bar will generate somedir/foo/somedir/foo/<favicon> as the output file.

In addition to the double nesting, doesn’t seem like you can override that behavior in order to fix it while in light mode.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
Tofandelcommented, Nov 4, 2019

You need to check for undefined on compilation.outputOptions.publicPath and not boolean Eg: const webpackPublicPath = typeof compilation.outputOptions.publicPath !== 'undefined' ? compilation.outputOptions.publicPath : '/';

Because the publicPath can be an empty string and that needs to be preserved

Also only the webpack public path is used not the options of the plugin… I’ll include it in the PR

0reactions
jantimoncommented, Dec 28, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

java - Error which "shouldn't happen" caused by ...
The JVM bug. This explains the code you've pasted: That malformed encoding stuff 'cannot occur', as per the comment, because lenient mode is...
Read more >
Auto Loader options - Azure Databricks
A column for storing records that are malformed and cannot be parsed. If the mode for parsing is set as DROPMALFORMED , this...
Read more >
path/filepath
Package filepath implements utility routines for manipulating filename paths in a way compatible with the target operating system-defined file paths.
Read more >
Options
Name Type Description # allow_hosts mitmproxy mitmdump mitmweb sequence of str Opposite of ‑‑ignore‑hosts... # client_replay mitmproxy mitmdump mitmweb sequence of str Replay client requests...
Read more >
Fixed issues in InDesign
We heard you! We've been working hard at fixing the issues you reported to us. Here's the list of issues we fixed in...
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