Malformed filepaths and output options ignored in 'light' mode
See original GitHub issueWhen 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_ENVto ‘development’, or change theFaviconsPlugin.modeto ‘light’ - Set Webpack’s
output.publicPathvalue tosomedir/foo - Set Plugin’s
publicPathvalue tosomedir/baras 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:
- Created 4 years ago
- Reactions:4
- Comments:10 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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
Fixed and released as https://www.npmjs.com/package/favicons-webpack-plugin/v/2.0.0